honeycomb

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

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

func NewContainer

func NewContainer(namespace []byte, db *DB) *Container

func (*Container) Container

func (c *Container) Container(namespace []byte) *Container

func (*Container) Delete

func (c *Container) Delete(key []byte) error

func (*Container) Get

func (c *Container) Get(key []byte) ([]byte, error)

func (*Container) GetObject

func (c *Container) GetObject(key []byte, dst any) error

func (*Container) Has

func (c *Container) Has(key []byte) bool

func (*Container) Iter

func (c *Container) Iter(iterFunc func(key, value []byte) error) error

func (*Container) IterPrefix

func (c *Container) IterPrefix(prefix []byte, iterFunc func(key, value []byte) error) error

func (*Container) Set

func (c *Container) Set(key, value []byte) error

func (*Container) SetObject

func (c *Container) SetObject(key []byte, value any) error

type DB

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

func NewDB

func NewDB(db *badger.DB, options *Option) *DB

func (*DB) Container

func (db *DB) Container(namespace []byte) *Container

type Option

type Option struct {
	Version     []byte
	Seperator   []byte
	Marshaller  func(any) ([]byte, error)
	Unmarshaler func([]byte, any) error
}

func DefaultOption

func DefaultOption() *Option

DefaultOption returns the default option, which uses CBOR as the marshaller and unmarshaller and ":" as the seperator.

Jump to

Keyboard shortcuts

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