store

package
v0.0.0-...-867e29d Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 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 Bolt

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

func NewBolt

func NewBolt(path string) (*Bolt, error)

func (*Bolt) CreateTable

func (c *Bolt) CreateTable(table string) (err error)

func (*Bolt) DropTable

func (c *Bolt) DropTable(table string) (err error)

func (*Bolt) GetKV

func (c *Bolt) GetKV(table, key string) (kv KV, err error)

func (*Bolt) NextID

func (c *Bolt) NextID(table string) (id string, err error)

func (*Bolt) ScanKV

func (c *Bolt) ScanKV(table, prefix string, logic func(key string, value []byte) bool) error

func (*Bolt) SetKV

func (c *Bolt) SetKV(table string, kvs []KV) error

type KV

type KV struct {
	Key   string
	Value []byte
}

func (KV) HasKey

func (c KV) HasKey() bool

func (KV) HasValue

func (c KV) HasValue() bool

type Store

type Store interface {
	CreateTable(table string) (err error)
	DropTable(table string) (err error)
	SetKV(table string, kvs []KV) (err error)
	GetKV(table, key string) (kv KV, err error)
	ScanKV(table, prefix string, logic func(key string, value []byte) bool) (err error)
	NextID(table string) (id string, err error)
}

Jump to

Keyboard shortcuts

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