lemodb

package module
v0.0.0-...-0b9bf3b Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NumberCpu = runtime.NumCPU()

Functions

func Debugf

func Debugf(format string, args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func Warningf

func Warningf(format string, args ...interface{})

Types

type Command

type Command byte
const (
	SET Command = iota
	DEL
	TTL
	LPUSH
	RPOP
	LREM
	LSET
	HSET
	HDEL
)

type DB

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

func Open

func Open(option *Option) *DB

func (*DB) Backup

func (db *DB) Backup(w io.Writer) uint64

func (*DB) CleanDelayCommit

func (db *DB) CleanDelayCommit()

func (*DB) Close

func (db *DB) Close()

func (*DB) Commit

func (db *DB) Commit() uint64

func (*DB) Count

func (db *DB) Count() int

func (*DB) Del

func (db *DB) Del(key string) error

func (*DB) DelayCommit

func (db *DB) DelayCommit() uint64

func (*DB) DelayEnd

func (db *DB) DelayEnd()

func (*DB) DelayStart

func (db *DB) DelayStart()

func (*DB) DropAll

func (db *DB) DropAll()

func (*DB) Expired

func (db *DB) Expired(key string, ttl time.Duration) error

func (*DB) Get

func (db *DB) Get(key string) (*String, error)

func (*DB) HDel

func (db *DB) HDel(key string, k string) error

func (*DB) HGet

func (db *DB) HGet(key string, k string) (string, error)

func (*DB) HGetAll

func (db *DB) HGetAll(key string) (*Hash, error)

func (*DB) HSet

func (db *DB) HSet(key string, k string, v string) error

func (*DB) Index

func (db *DB) Index() uint64

func (*DB) Keys

func (db *DB) Keys(fn func(tp Type, ttl int64, key string) bool)

func (*DB) LPush

func (db *DB) LPush(key string, value ...string) error

func (*DB) LRem

func (db *DB) LRem(key string, index int) (string, error)

func (*DB) LRemV

func (db *DB) LRemV(key string, value string) (string, error)

func (*DB) LSet

func (db *DB) LSet(key string, index int, value string) error

func (*DB) List

func (db *DB) List(key string) (*List, error)

func (*DB) RPop

func (db *DB) RPop(key string) (string, error)

func (*DB) Restore

func (db *DB) Restore(r io.Reader) uint64

func (*DB) Set

func (db *DB) Set(key string, value string) error

func (*DB) Start

func (db *DB) Start()

func (*DB) TTL

func (db *DB) TTL(key string) (time.Duration, error)

func (*DB) Transaction

func (db *DB) Transaction()

type Hash

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

func (*Hash) Len

func (h *Hash) Len() int

func (*Hash) Range

func (h *Hash) Range(fn func(key string, value string))

func (*Hash) Value

func (h *Hash) Value() map[string]string

type List

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

func (*List) Len

func (l *List) Len() int

func (*List) Range

func (l *List) Range(fn func(value string))

func (*List) Value

func (l *List) Value() []string

type Logger

type Logger interface {
	Infof(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Warningf(format string, args ...interface{})
}

type Option

type Option struct {
	Path   string
	Logger Logger
}

type String

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

func (*String) Value

func (s *String) Value() string

type Type

type Type byte
const (
	STRING Type = iota
	LIST
	HASH
)

func (Type) String

func (t Type) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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