localdb

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileDB

func NewFileDB[T any](filePath string) (types.DBCollectionInterface[T], error)

Types

type FileDB

type FileDB[T any] struct {
	// contains filtered or unexported fields
}

func (*FileDB[T]) BatchSet

func (db *FileDB[T]) BatchSet(pairs []types.KeyValue[T]) (int, error)

func (*FileDB[T]) Get

func (db *FileDB[T]) Get(key string) (T, bool)

func (*FileDB[T]) GetAll

func (db *FileDB[T]) GetAll() []types.KeyValue[T]

func (*FileDB[T]) ScanGet

func (db *FileDB[T]) ScanGet(key string) (types.KeyValue[T], bool)

func (*FileDB[T]) Set

func (db *FileDB[T]) Set(key string, value T) error

func (*FileDB[T]) StartInit added in v0.8.4

func (db *FileDB[T]) StartInit()

type FileDBState added in v0.8.4

type FileDBState int
const (
	FileDBStateNotStarted FileDBState = iota
	FileDBStateNotReady
	FileDBStateReady
)

Jump to

Keyboard shortcuts

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