db

package
v0.0.0-...-908ee96 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func NewDatabase

func NewDatabase(dbPath string, readOnly bool) (db *Database, closeFunc func() error, err error)

func (*Database) DeleteExtraKeys

func (d *Database) DeleteExtraKeys(isExtra func(string) bool) error

DeleteExtraKeys deletes extra keys that do not belong to this shard.

func (*Database) DeleteReplicaKey

func (d *Database) DeleteReplicaKey(key, value []byte) (err error)

DeleteReplicaKey deletes key from replication queue.

func (*Database) Get

func (d *Database) Get(key string) ([]byte, error)

Get key

func (*Database) GetOldKey

func (d *Database) GetOldKey() (key, value []byte, err error)

GetOldKey returns key and value that have not been applied to replicas, if no such keys exist, returns nil key and nil value.

func (*Database) Set

func (d *Database) Set(key string, value []byte) error

Set key

func (*Database) SetReplica

func (d *Database) SetReplica(key string, value []byte) error

SetReplica this function is intended to be used only on replicas. It sets the key value into default bucket without writes to replication queue.

Jump to

Keyboard shortcuts

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