backend

package
v0.0.5-beta-2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Name() string
	Set(key []byte, value []byte, expiry time.Duration) error
	Get(key []byte) ([]byte, error)
	RangeIterator(fromKy []byte, toKey []byte) Iterator
	Iterator() Iterator
	Delete(key []byte) error
	SetExpiry(time time.Duration)
	String() string
	Persistent() bool
	Close() error
	Destroy() error
}

func NewMockBackend

func NewMockBackend(name string, expiry time.Duration) Backend

type Builder

type Builder func(name string) (Backend, error)

type Iterator

type Iterator interface {
	SeekToFirst()
	SeekToLast()
	Seek(key []byte)
	Next()
	Prev()
	Close()
	Key() []byte
	Value() []byte
	Valid() bool
	Error() error
}

type MockBackend

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

func (*MockBackend) Close

func (*MockBackend) Close() error

func (*MockBackend) Delete

func (b *MockBackend) Delete(key []byte) error

func (*MockBackend) Destroy

func (*MockBackend) Destroy() error

func (*MockBackend) Get

func (b *MockBackend) Get(key []byte) ([]byte, error)

func (*MockBackend) Iterator

func (*MockBackend) Iterator() Iterator

func (*MockBackend) Name

func (b *MockBackend) Name() string

func (*MockBackend) Persistent

func (b *MockBackend) Persistent() bool

func (*MockBackend) RangeIterator

func (b *MockBackend) RangeIterator(fromKy []byte, toKey []byte) Iterator

func (*MockBackend) Set

func (b *MockBackend) Set(key []byte, value []byte, expiry time.Duration) error

func (*MockBackend) SetExpiry

func (b *MockBackend) SetExpiry(time time.Duration)

func (*MockBackend) String

func (b *MockBackend) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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