msgpack

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package msgpack contains the msgpack en/de-coder.

Index

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

func (j *Codec) ContentTypes() []string

ContentTypes returns the content types the marshaler can handle.

func (*Codec) Exts

func (j *Codec) Exts() []string

Exts is a list of file extensions this marshaler supports.

func (*Codec) Marshal

func (j *Codec) Marshal(v any) ([]byte, error)

Marshal marshals any object into json bytes. Param v should be a pointer type.

func (*Codec) Marshals

func (j *Codec) Marshals(_ any) bool

Marshals returns if this is able to encode the given type.

func (*Codec) Name

func (j *Codec) Name() string

Name returns the codec name.

func (*Codec) NewDecoder

func (j *Codec) NewDecoder(r io.Reader) codecs.Decoder

NewDecoder returns a new JSON decoder.

func (*Codec) NewEncoder

func (j *Codec) NewEncoder(w io.Writer) codecs.Encoder

NewEncoder returns a new JSON encoder.

func (*Codec) Unmarshal

func (j *Codec) Unmarshal(data []byte, v any) error

Unmarshal decodes json bytes into object v. Param v should be a pointer type.

func (*Codec) Unmarshals

func (j *Codec) Unmarshals(_ any) bool

Unmarshals returns if this is able to decode the given type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL