store

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package store provides the badger db to be used by higher level packages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	// DataPath must return the path of the directory where the database is or will be created
	DataPath() string
}

Config provides config values for store

func NewConfig

func NewConfig(c general.Config) (Config, error)

NewConfig provides a Config

func NewConfigInMem

func NewConfigInMem() Config

NewConfigInMem provides a Config with an empty string DataPath causing an in memory database

type Sequence added in v0.2.0

type Sequence interface {
	Next() (uint64, error)
}

Sequence provides a way to get ever incressing numbers *** needs to be moved somwhere more general

type Store

type Store interface {
	BadgerDB() *badger.DB
	WriteBuffered(*badger.Entry)
	GetSequence(key []byte) (Sequence, error)
}

Store allows writting, reading and searching records

func New

func New(config Config) (Store, error)

New creates a Store

Jump to

Keyboard shortcuts

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