mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
r/RegisterType/RegisterNamespace/g
Co-Author: Matt Holt
This commit is contained in:
parent
52441e3037
commit
18b346f6f9
15 changed files with 23 additions and 23 deletions
2
admin.go
2
admin.go
|
@ -55,7 +55,7 @@ func init() {
|
|||
if env, exists := os.LookupEnv("CADDY_ADMIN"); exists {
|
||||
DefaultAdminListen = env
|
||||
}
|
||||
RegisterType("caddy.config_loaders", []interface{}{(*ConfigLoader)(nil)})
|
||||
RegisterNamespace("caddy.config_loaders", []interface{}{(*ConfigLoader)(nil)})
|
||||
}
|
||||
|
||||
// AdminConfig configures Caddy's API endpoint, which is used
|
||||
|
|
4
caddy.go
4
caddy.go
|
@ -42,10 +42,10 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
RegisterType("", []interface{}{
|
||||
RegisterNamespace("", []interface{}{
|
||||
(*App)(nil),
|
||||
})
|
||||
RegisterType("caddy.storage", []interface{}{
|
||||
RegisterNamespace("caddy.storage", []interface{}{
|
||||
(*StorageConverter)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
RegisterType("caddy.listeners", []interface{}{
|
||||
RegisterNamespace("caddy.listeners", []interface{}{
|
||||
(*ListenerWrapper)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ func init() {
|
|||
RegisterModule(StdoutWriter{})
|
||||
RegisterModule(StderrWriter{})
|
||||
RegisterModule(DiscardWriter{})
|
||||
RegisterType("caddy.logging.encoders", []interface{}{
|
||||
RegisterNamespace("caddy.logging.encoders", []interface{}{
|
||||
(*zapcore.Encoder)(nil),
|
||||
})
|
||||
RegisterType("caddy.logging.writers", []interface{}{
|
||||
RegisterNamespace("caddy.logging.writers", []interface{}{
|
||||
(*WriterOpener)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -32,10 +32,10 @@ import (
|
|||
func init() {
|
||||
caddy.RegisterModule(HTTPBasicAuth{})
|
||||
|
||||
caddy.RegisterType("http.authentication.hashes", []interface{}{
|
||||
caddy.RegisterNamespace("http.authentication.hashes", []interface{}{
|
||||
(*Comparer)(nil),
|
||||
})
|
||||
caddy.RegisterType("http.authentication.providers", []interface{}{
|
||||
caddy.RegisterNamespace("http.authentication.providers", []interface{}{
|
||||
(*Authenticator)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import (
|
|||
|
||||
func init() {
|
||||
caddy.RegisterModule(Encode{})
|
||||
caddy.RegisterType("http.encoders", []interface{}{
|
||||
caddy.RegisterNamespace("http.encoders", []interface{}{
|
||||
(*Encoding)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
caddy.RegisterType("http.precompressed", []interface{}{
|
||||
caddy.RegisterNamespace("http.precompressed", []interface{}{
|
||||
(*encode.Precompressed)(nil),
|
||||
})
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ func init() {
|
|||
caddy.RegisterModule(MatchHeaderRE{})
|
||||
caddy.RegisterModule(new(MatchProtocol))
|
||||
caddy.RegisterModule(MatchNot{})
|
||||
caddy.RegisterType("http.matchers", []interface{}{
|
||||
caddy.RegisterNamespace("http.matchers", []interface{}{
|
||||
(*RequestMatcher)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -46,16 +46,16 @@ import (
|
|||
func init() {
|
||||
caddy.RegisterModule(Handler{})
|
||||
|
||||
caddy.RegisterType("http.reverse_proxy.circuit_breakers", []interface{}{
|
||||
caddy.RegisterNamespace("http.reverse_proxy.circuit_breakers", []interface{}{
|
||||
(*CircuitBreaker)(nil),
|
||||
})
|
||||
caddy.RegisterType("http.reverse_proxy.selection_policies", []interface{}{
|
||||
caddy.RegisterNamespace("http.reverse_proxy.selection_policies", []interface{}{
|
||||
(*Selector)(nil),
|
||||
})
|
||||
caddy.RegisterType("http.reverse_proxy.transport", []interface{}{
|
||||
caddy.RegisterNamespace("http.reverse_proxy.transport", []interface{}{
|
||||
(*http.RoundTripper)(nil),
|
||||
})
|
||||
caddy.RegisterType("http.reverse_proxy.upstreams", []interface{}{
|
||||
caddy.RegisterNamespace("http.reverse_proxy.upstreams", []interface{}{
|
||||
(*UpstreamSource)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
caddy.RegisterType("http.handlers", []interface{}{
|
||||
caddy.RegisterNamespace("http.handlers", []interface{}{
|
||||
(*MiddlewareHandler)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -31,13 +31,13 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
caddy.RegisterType("dns.provider", []interface{}{
|
||||
caddy.RegisterNamespace("dns.provider", []interface{}{
|
||||
(*acmez.Solver)(nil),
|
||||
})
|
||||
caddy.RegisterType("tls.get_certificate", []interface{}{
|
||||
caddy.RegisterNamespace("tls.get_certificate", []interface{}{
|
||||
(*certmagic.Manager)(nil),
|
||||
})
|
||||
caddy.RegisterType("tls.issuance", []interface{}{
|
||||
caddy.RegisterNamespace("tls.issuance", []interface{}{
|
||||
(*certmagic.Issuer)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import (
|
|||
|
||||
func init() {
|
||||
caddy.RegisterModule(LeafCertClientAuth{})
|
||||
caddy.RegisterType("tls.handshake_match", []interface{}{
|
||||
caddy.RegisterNamespace("tls.handshake_match", []interface{}{
|
||||
(*ConnectionMatcher)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
caddy.RegisterType("tls.stek", []interface{}{
|
||||
caddy.RegisterNamespace("tls.stek", []interface{}{
|
||||
(*STEKProvider)(nil),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ func init() {
|
|||
caddy.RegisterModule(TLS{})
|
||||
caddy.RegisterModule(AutomateLoader{})
|
||||
|
||||
caddy.RegisterType("tls.certificates", []interface{}{
|
||||
caddy.RegisterNamespace("tls.certificates", []interface{}{
|
||||
(*CertificateLoader)(nil),
|
||||
})
|
||||
}
|
||||
|
|
2
types.go
2
types.go
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
var namespaceTypes map[string][]reflect.Type = make(map[string][]reflect.Type)
|
||||
|
||||
func RegisterType(namespace string, vals []interface{}) {
|
||||
func RegisterNamespace(namespace string, vals []interface{}) {
|
||||
var types []reflect.Type
|
||||
for _, v := range vals {
|
||||
reflect.TypeOf(v).Elem()
|
||||
|
|
Loading…
Reference in a new issue