batch

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

func New

func New(db Batchable, logger storage.Logger) *Batch

func (*Batch) Commit

func (b *Batch) Commit() error

func (*Batch) Discard

func (b *Batch) Discard()

func (*Batch) Get

func (b *Batch) Get(key storage.Key) (v []byte, err error)

func (*Batch) Put

func (b *Batch) Put(key storage.Key, value []byte)

func (*Batch) PutAll

func (b *Batch) PutAll(values map[storage.Key][]byte)

type Batchable

type Batchable interface {
	Get(storage.Key) ([]byte, error)
	EndBatch(map[storage.Key][]byte) error
}

Jump to

Keyboard shortcuts

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