Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface {
Decode(
w http.ResponseWriter,
r *http.Request,
data interface{},
) (err error)
}
Decoder interface
type DefaultDecoder ¶
type DefaultDecoder struct {
// contains filtered or unexported fields
}
DefaultDecoder struct
func NewDefaultDecoder ¶
func NewDefaultDecoder( mode *goflagsmode.Flag, encoder Encoder, ) (*DefaultDecoder, error)
NewDefaultDecoder creates a new JSON decoder
func (*DefaultDecoder) Decode ¶
func (d *DefaultDecoder) Decode( w http.ResponseWriter, r *http.Request, data interface{}, ) (err error)
Decode decodes the JSON data from the request
type DefaultEncoder ¶
type DefaultEncoder struct {
// contains filtered or unexported fields
}
DefaultEncoder struct
func NewDefaultEncoder ¶
func NewDefaultEncoder(mode *mode.Flag) *DefaultEncoder
NewDefaultEncoder creates a new default JSON encoder
func (*DefaultEncoder) Encode ¶
func (d *DefaultEncoder) Encode( w http.ResponseWriter, data interface{}, code int, ) (err error)
Encode encodes the given data to JSON
type DefaultStreamDecoder ¶
type DefaultStreamDecoder struct {
// contains filtered or unexported fields
}
DefaultStreamDecoder is the JSON decoder struct
func NewDefaultStreamDecoder ¶
func NewDefaultStreamDecoder( mode *goflagsmode.Flag, encoder Encoder, ) (*DefaultStreamDecoder, error)
NewDefaultStreamDecoder creates a new JSON decoder
func (*DefaultStreamDecoder) Decode ¶
func (d *DefaultStreamDecoder) Decode( w http.ResponseWriter, r *http.Request, data interface{}, ) (err error)
Decode decodes the JSON data
type DefaultStreamEncoder ¶
type DefaultStreamEncoder struct {
// contains filtered or unexported fields
}
DefaultStreamEncoder is the JSON encoder struct
func NewDefaultStreamEncoder ¶
func NewDefaultStreamEncoder(mode *goflagsmode.Flag) *DefaultStreamEncoder
NewDefaultStreamEncoder creates a new JSON encoder
func (*DefaultStreamEncoder) Encode ¶
func (d *DefaultStreamEncoder) Encode( w http.ResponseWriter, data interface{}, code int, ) (err error)
Encode encodes the data into JSON
Click to show internal directories.
Click to hide internal directories.