Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AvailableEncodings = []string{
"application/json",
"text/xml",
"application/yaml",
"text/html",
"application/x-www-form-urlencoded",
"application/msgpack",
}
View Source
var ErrNoEncoderAvailable = errors.New("codec not available")
Functions ¶
func AvailableCodecs ¶
func RegisterCodec ¶
Types ¶
type Codec ¶
type Codec struct {
NewEncoder NewEncoderFunc
NewDecoder NewDecoderFunc
}
type Encoder ¶
type Encoder interface {
Encode(v interface{}) error
}
func AcceptEncoder ¶
func AcceptEncoder(w http.ResponseWriter, acceptHeader string, edit EditMode) Encoder
type NewDecoderFunc ¶
func WrapDecoder ¶
func WrapDecoder[D Decoder, F func(r io.Reader) D](f F) NewDecoderFunc
type NewEncoderFunc ¶
func WrapEncoder ¶
func WrapEncoder[E Encoder, F func(w io.Writer) E](f F) NewEncoderFunc
Click to show internal directories.
Click to hide internal directories.