mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-07 05:21:04 +08:00
Defer loading directives until needed (fix for previous commit)
This change is still experimental.
This commit is contained in:
11
plugins.go
11
plugins.go
@ -79,7 +79,7 @@ func ValidDirectives(serverType string) []string {
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
return stype.Directives
|
||||
return stype.Directives()
|
||||
}
|
||||
|
||||
// ServerListener pairs a server to its listener and/or packetconn.
|
||||
@ -145,10 +145,11 @@ func RegisterServerType(typeName string, srv ServerType) {
|
||||
|
||||
// ServerType contains information about a server type.
|
||||
type ServerType struct {
|
||||
// List of directives, in execution order, that are
|
||||
// valid for this server type. Directives should be
|
||||
// one word if possible and lower-cased.
|
||||
Directives []string
|
||||
// Function that returns the list of directives, in
|
||||
// execution order, that are valid for this server
|
||||
// type. Directives should be one word if possible
|
||||
// and lower-cased.
|
||||
Directives func() []string
|
||||
|
||||
// DefaultInput returns a default config input if none
|
||||
// is otherwise loaded. This is optional, but highly
|
||||
|
Reference in New Issue
Block a user