ko

package module
v0.0.0-...-c7a04eb Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 14 Imported by: 1

README

ko

Test

in memory storage with persistence adapter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Path string
	// contains filtered or unexported fields
}

Storage composition of Database interface

func (*Storage) Active

func (db *Storage) Active() bool

Active provides access to the status of the storage client

func (*Storage) Clear

func (db *Storage) Clear()

Clear all keys in the storage

func (*Storage) Close

func (db *Storage) Close()

Close the storage client

func (*Storage) Del

func (db *Storage) Del(path string) error

Del a key/pattern value(s)

func (*Storage) Get

func (db *Storage) Get(path string) ([]byte, error)

Get a key/pattern related value(s)

func (*Storage) GetAndLock

func (db *Storage) GetAndLock(path string) ([]byte, error)

func (*Storage) GetDecodedList

func (db *Storage) GetDecodedList(path string) ([]meta.Object, error)

GetDecodedList force base64 decoding and bypass sorting

func (*Storage) GetDescending

func (db *Storage) GetDescending(path string) ([]byte, error)

func (*Storage) GetN

func (db *Storage) GetN(path string, limit int) ([]meta.Object, error)

GetN get last N elements of a path related value(s)

func (*Storage) GetNAscending

func (db *Storage) GetNAscending(path string, limit int) ([]meta.Object, error)

func (*Storage) GetNRange

func (db *Storage) GetNRange(path string, limit int, from, to int64) ([]meta.Object, error)

GetNRange get last N elements of a path related value(s) for a given time range

func (*Storage) Keys

func (db *Storage) Keys() ([]byte, error)

Keys list all the keys in the storage

func (*Storage) KeysRange

func (db *Storage) KeysRange(path string, from, to int64) ([]string, error)

KeysRange list keys in a path and time range

func (*Storage) Peek

func (db *Storage) Peek(key string, now int64) (int64, int64)

Peek a value timestamps

func (*Storage) Set

func (db *Storage) Set(path string, data json.RawMessage) (string, error)

Set a value

func (*Storage) SetAndUnlock

func (db *Storage) SetAndUnlock(path string, data json.RawMessage) (string, error)

func (*Storage) SetForce

func (db *Storage) SetForce(path string, data json.RawMessage, created int64, updated int64) (string, error)

SetForce set entries on a pivot instance (force created/updated values)

func (*Storage) Start

func (db *Storage) Start(storageOpt ooo.StorageOpt) error

Start the storage client

func (*Storage) Unlock

func (db *Storage) Unlock(path string) error

func (*Storage) Watch

func (db *Storage) Watch() ooo.StorageChan

Watch the storage set/del events

Jump to

Keyboard shortcuts

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