db

package
v0.0.0-...-2ef4a2e Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParseInt

func MustParseInt(val []byte) int64

Types

type Database

type Database struct {
	MaxPartitionNum int
	LocalDataDir    string
	Singleton       bool
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(storage *storage.ObjectStorage, MaxPartitionNum int, LocalDataDir string, Singleton bool) *Database

func (*Database) Get

func (c *Database) Get(ctx context.Context, key []byte) ([]byte, *time.Time, error)

func (*Database) Info

func (db *Database) Info(ctx context.Context) (*Info, error)

func (*Database) Set

func (db *Database) Set(ctx context.Context, key []byte, w func([]byte, *time.Time) ([]byte, *time.Time, error)) error

Set sets the value for a key.

Buckets:

system: {
    version: "1",
    keys: "number of keys",
    expires: "number of keys with an expiration",
    total_write_commands_processed: "Total number of write commands processed by the server"
}

value: {
	$key: $value
}

pxat: {
    $key: "Unix timestamp at which the key will expire, in milliseconds."
}

type Info

type Info struct {
	Keys                        int64
	Expires                     int64
	TotalWriteCommandsProcessed int64
}

type Leader

type Leader struct {
	UUID string `json:"uuid"`
}

type Partition

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

Jump to

Keyboard shortcuts

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