bbolt

package
v0.2.10-18 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "bolt"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*bolt.DB
	// contains filtered or unexported fields
}

func New added in v0.2.2

func New(cfg *Config, log log.Logger) *Client

func (*Client) Delete added in v0.1.26

func (t *Client) Delete(ctx context.Context, key string, names ...string) error

func (*Client) Get added in v0.1.26

func (t *Client) Get(ctx context.Context, key string, names ...string) result.Result[[]byte]

func (*Client) List added in v0.1.26

func (t *Client) List(ctx context.Context, fn func(k, v []byte) error, names ...string) error

func (*Client) Set added in v0.1.26

func (t *Client) Set(ctx context.Context, key string, val []byte, names ...string) error

func (*Client) Update

func (t *Client) Update(ctx context.Context, fn func(*bolt.Bucket) error, names ...string) error

func (*Client) View

func (t *Client) View(ctx context.Context, fn func(*bolt.Bucket) error, names ...string) error

type Config

type Config struct {
	FileMode        fs.FileMode       `json:"file_mode"`
	Timeout         time.Duration     `json:"timeout"`
	NoGrowSync      bool              `json:"no_grow_sync"`
	NoFreelistSync  bool              `json:"no_freelist_sync"`
	FreelistType    bolt.FreelistType `json:"freelist_type"`
	ReadOnly        bool              `json:"read_only"`
	MmapFlags       int               `json:"mmap_flags"`
	InitialMmapSize int               `json:"initial_mmap_size"`
	PageSize        int               `json:"page_size"`
	NoSync          bool              `json:"no_sync"`
	Path            string            `json:"path"`
}

func DefaultConfig

func DefaultConfig() *Config

Jump to

Keyboard shortcuts

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