msgpack

package
v2.681.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package msgpack provides MessagePack encoding helpers and adapters used by go-service.

This package integrates MessagePack encoding/decoding behind the go-service encoding abstraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v any) ([]byte, error)

Marshal encodes v as MessagePack.

func Unmarshal

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

Unmarshal decodes one MessagePack value from data into v.

It uses Decode, so it rejects trailing encoded values or malformed trailing data.

Types

type Encoder

type Encoder struct{}

Encoder implements MessagePack encoding and decoding.

func NewEncoder

func NewEncoder() *Encoder

NewEncoder constructs a MessagePack encoder.

func (*Encoder) Decode

func (e *Encoder) Decode(r io.Reader, v any) error

Decode reads one MessagePack value from r and decodes it into v.

It rejects trailing encoded values or malformed trailing data.

func (*Encoder) Encode

func (e *Encoder) Encode(w io.Writer, v any) error

Encode writes v to w as MessagePack.

Jump to

Keyboard shortcuts

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