mirror of
https://github.com/ggicci/httpin.git
synced 2024-11-30 08:56:52 +02:00
20 lines
296 B
Go
20 lines
296 B
Go
package httpin
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"github.com/ggicci/httpin/internal"
|
|
)
|
|
|
|
type Decoder internal.Decoder
|
|
|
|
var decoders = map[reflect.Type]Decoder{} // custom decoders
|
|
|
|
func decoderOf(t reflect.Type) Decoder {
|
|
dec := decoders[t]
|
|
if dec != nil {
|
|
return dec
|
|
}
|
|
return internal.DecoderOf(t)
|
|
}
|