Documentation
¶
Overview ¶
Package msgpack contains the msgpack en/de-coder.
Index ¶
- type Codec
- func (j *Codec) ContentTypes() []string
- func (j *Codec) Exts() []string
- func (j *Codec) Marshal(v any) ([]byte, error)
- func (j *Codec) Marshals(_ any) bool
- func (j *Codec) Name() string
- func (j *Codec) NewDecoder(r io.Reader) codecs.Decoder
- func (j *Codec) NewEncoder(w io.Writer) codecs.Encoder
- func (j *Codec) Unmarshal(data []byte, v any) error
- func (j *Codec) Unmarshals(_ any) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct{}
Codec implements the codecs.Marshal interface, and can be used for marshaling Codec config files, and web requests.
func (*Codec) ContentTypes ¶
ContentTypes returns the content types the marshaler can handle.
func (*Codec) Marshal ¶
Marshal marshals any object into json bytes. Param v should be a pointer type.
func (*Codec) NewDecoder ¶
NewDecoder returns a new JSON decoder.
func (*Codec) NewEncoder ¶
NewEncoder returns a new JSON encoder.
func (*Codec) Unmarshal ¶
Unmarshal decodes json bytes into object v. Param v should be a pointer type.
func (*Codec) Unmarshals ¶
Unmarshals returns if this is able to decode the given type.
Click to show internal directories.
Click to hide internal directories.