db

package
v0.0.0-...-6712e0e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STRING uint8 = 1
	INT    uint8 = 2
	LIST   uint8 = 3
	SET    uint8 = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB() *DB

func (*DB) Close

func (d *DB) Close()

func (*DB) Del

func (d *DB) Del(key string)

func (*DB) DelExpireKey

func (d *DB) DelExpireKey()

func (*DB) Get

func (d *DB) Get(key string) *Entity

func (*DB) PurgePeriodically

func (d *DB) PurgePeriodically()

func (*DB) Set

func (d *DB) Set(key string, entity *Entity)

func (*DB) Size

func (d *DB) Size() int

type Entity

type Entity struct {
	Types    uint8
	Data     unsafe.Pointer
	LastRead int64
	ExpireAt int64
}

type HashSet

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

func NewHashSet

func NewHashSet() *HashSet

func (*HashSet) Add

func (h *HashSet) Add(items ...[]byte)

func (*HashSet) Contains

func (h *HashSet) Contains(item []byte) bool

func (*HashSet) Len

func (h *HashSet) Len() int

func (*HashSet) Remove

func (h *HashSet) Remove(items ...[]byte)

func (*HashSet) Values

func (h *HashSet) Values() [][]byte

type List

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

func (*List) Index

func (l *List) Index(index int) []byte

func (*List) LPop

func (l *List) LPop() []byte

func (*List) LPush

func (l *List) LPush(data []byte)

func (*List) Len

func (l *List) Len() int

func (*List) RPop

func (l *List) RPop() []byte

func (*List) RPush

func (l *List) RPush(data []byte)

func (*List) Range

func (l *List) Range(start, end int) [][]byte

Jump to

Keyboard shortcuts

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