tuple

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedKeyType = errors.New("unsupported key type")

Functions

This section is empty.

Types

type Coder

type Coder struct {
}

Coder represents a CBOR erializer.

func NewCoder

func NewCoder() *Coder

NewCoder returns a new CBOR erializer instance.

func (*Coder) DecodeKey

func (s *Coder) DecodeKey(b []byte) (document.Key, error)

DecodeKey returns the decoded key from the specified bytes if available, otherwise returns an error.

func (*Coder) EncodeKey

func (s *Coder) EncodeKey(key document.Key) ([]byte, error)

EncodeKey returns the encoded bytes from the specified key if available, otherwise returns an error.

func (*Coder) Start

func (s *Coder) Start() error

Start starts this coder.

func (*Coder) Stop

func (s *Coder) Stop() error

Stop stops this coder.

type Tuple

type Tuple []interface{}

Tuple represents a tuple of elements that can be packed into a sortable byte sequence.

func Unpack

func Unpack(data []byte) (Tuple, error)

Unpack decodes a byte slice into a tuple.

func (Tuple) Pack

func (t Tuple) Pack() []byte

Pack encodes the tuple into a byte slice using gob encoding.

Jump to

Keyboard shortcuts

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