Help us shape the future of Go! Take the 2026 Go Developer Survey

zbor

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec struct {
	// contains filtered or unexported fields
}

Codec encodes and decodes Go values using cbor encoding and zstandard compression.

func NewCodec

func NewCodec() *Codec

NewCodec creates a new Codec.

func (*Codec) Compress

func (c *Codec) Compress(data []byte) ([]byte, error)

Compress encodes the given bytes into a compressed format using zstandard.

func (*Codec) Decode

func (c *Codec) Decode(data []byte, value interface{}) error

Decode parses CBOR-encoded data into the given value.

func (*Codec) Decompress

func (c *Codec) Decompress(compressed []byte) ([]byte, error)

Decompress reads compressed data that uses the zstandard format and returns the original uncompressed byte slice.

func (*Codec) Encode

func (c *Codec) Encode(value interface{}) ([]byte, error)

Encode returns the CBOR encoding of the given value.

func (*Codec) Marshal

func (c *Codec) Marshal(value interface{}) ([]byte, error)

Marshal encodes the given value and then compresses it, and returns the resulting slice of bytes.

func (*Codec) Unmarshal

func (c *Codec) Unmarshal(compressed []byte, value interface{}) error

Unmarshal decompresses the given bytes and decodes the resulting CBOR-encoded data into the given value.

Jump to

Keyboard shortcuts

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