storage

package
v0.0.0-...-b1d25d0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImmuClient

type ImmuClient interface {
	OpenSession(ctx context.Context, user []byte, pass []byte, database string) (err error)
	CloseSession(ctx context.Context) error
	WithOptions(options *immudb.Options) ImmuClient
	Set(ctx context.Context, key []byte, value []byte) (*schema.TxHeader, error)
	Scan(ctx context.Context, req *schema.ScanRequest) (*schema.Entries, error)
	SetAll(ctx context.Context, kvList *schema.SetRequest) (*schema.TxHeader, error)
}

ImmuClient is a subset of insanely huge immudb.ImmuClient it contains only the functions we really need

type ImmuDB

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

func NewImmuDB

func NewImmuDB(opts *immudb.Options) *ImmuDB

func (*ImmuDB) All

func (i *ImmuDB) All(b bucket.Bucket) ([]log.Entry, error)

func (*ImmuDB) Count

func (i *ImmuDB) Count(b bucket.Bucket) (uint64, error)

func (*ImmuDB) Last

func (i *ImmuDB) Last(b bucket.Bucket, n uint64) ([]log.Entry, error)

func (*ImmuDB) Start

func (i *ImmuDB) Start(ctx context.Context) error

func (*ImmuDB) Stop

func (i *ImmuDB) Stop() error

func (*ImmuDB) WriteBatch

func (i *ImmuDB) WriteBatch(b bucket.Bucket, e []log.Entry) (map[string]any, error)

func (*ImmuDB) WriteOne

func (i *ImmuDB) WriteOne(b bucket.Bucket, e log.Entry) (map[string]any, error)

type Memory

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

func NewMemory

func NewMemory() *Memory

func (*Memory) All

func (m *Memory) All(b bucket.Bucket) ([]log.Entry, error)

func (*Memory) Count

func (m *Memory) Count(b bucket.Bucket) (uint64, error)

func (*Memory) Last

func (m *Memory) Last(b bucket.Bucket, n uint64) ([]log.Entry, error)

func (*Memory) Start

func (m *Memory) Start(_ context.Context) error

func (*Memory) Stop

func (m *Memory) Stop() error

func (*Memory) WriteBatch

func (m *Memory) WriteBatch(b bucket.Bucket, e []log.Entry) (map[string]any, error)

func (*Memory) WriteOne

func (m *Memory) WriteOne(b bucket.Bucket, e log.Entry) (map[string]any, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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