1
0
mirror of https://github.com/ggicci/httpin.git synced 2024-11-30 08:56:52 +02:00
httpin/decoders.go

20 lines
296 B
Go
Raw Normal View History

package httpin
2021-05-03 16:19:54 +02:00
import (
"reflect"
"github.com/ggicci/httpin/internal"
)
2021-05-03 16:19:54 +02:00
type Decoder internal.Decoder
2021-05-03 16:19:54 +02:00
var decoders = map[reflect.Type]Decoder{} // custom decoders
2021-05-03 16:19:54 +02:00
func decoderOf(t reflect.Type) Decoder {
dec := decoders[t]
2021-05-03 16:19:54 +02:00
if dec != nil {
return dec
}
return internal.DecoderOf(t)
2021-05-03 16:19:54 +02:00
}