mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-03 22:33:28 +00:00
own the usage of reflection into the RegisterType
allowing the users to only pass instances of the interfaces
This commit is contained in:
parent
52f43d2f4c
commit
b825a10927
16 changed files with 50 additions and 61 deletions
|
|
@ -26,7 +26,6 @@ import (
|
|||
"math"
|
||||
"net"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -38,8 +37,8 @@ import (
|
|||
|
||||
func init() {
|
||||
caddy.RegisterModule(Encode{})
|
||||
caddy.RegisterType("http.encoders", []reflect.Type{
|
||||
reflect.TypeOf((*Encoding)(nil)).Elem(),
|
||||
caddy.RegisterType("http.encoders", []interface{}{
|
||||
(*Encoding)(nil),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue