zbor

package
v0.31.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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