boltkv

package
v6.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootPluginName string = "kv"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// File is boltDB file. No need to create it by your own,
	// boltdb driver is able to create the file, or read existing
	File string `mapstructure:"file"`

	// db file permissions
	Permissions int `mapstructure:"permissions"`
	// timeout
	Interval int `mapstructure:"interval"`
	// contains filtered or unexported fields
}

func (*Config) InitDefaults

func (s *Config) InitDefaults()

InitDefaults initializes default values for the boltdb

type Configurer

type Configurer interface {
	// UnmarshalKey takes a single key and unmarshal it into a Struct.
	UnmarshalKey(name string, out any) error
	// Has checks if config section exists.
	Has(name string) bool
}

type Driver

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

func NewBoltDBDriver

func NewBoltDBDriver(log *slog.Logger, key string, cfgPlugin Configurer, tracer *sdktrace.TracerProvider) (*Driver, error)

func (*Driver) Clear

func (d *Driver) Clear(ctx context.Context) error

func (*Driver) Delete

func (d *Driver) Delete(ctx context.Context, keys ...string) error

func (*Driver) Get

func (d *Driver) Get(ctx context.Context, key string) ([]byte, error)

func (*Driver) Has

func (d *Driver) Has(ctx context.Context, keys ...string) (map[string]bool, error)

func (*Driver) MExpire

func (d *Driver) MExpire(ctx context.Context, items ...kv.Item) error

func (*Driver) MGet

func (d *Driver) MGet(ctx context.Context, keys ...string) (map[string][]byte, error)

func (*Driver) Set

func (d *Driver) Set(ctx context.Context, items ...kv.Item) error

func (*Driver) Stop

func (d *Driver) Stop(_ context.Context)

func (*Driver) TTL

func (d *Driver) TTL(ctx context.Context, keys ...string) (map[string]string, error)

Jump to

Keyboard shortcuts

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