kv

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KV

type KV interface {
	Close()
	Write() Write
	ExclusiveWrite(ctx context.Context, keys ...[]byte) (Write, error)
	Read() Read
	Ping() error
}

func NewTikv

func NewTikv() (KV, error)

type KeyAndValue

type KeyAndValue struct {
	K []byte
	V []byte
}

type Read

type Read interface {
	BatchGet(ctx context.Context, keys [][]byte) (map[string][]byte, error)
	Get(ctx context.Context, key []byte) ([]byte, error)
	Iter(ctx context.Context, srart []byte, end []byte) iter.Seq2[KeyAndValue, error]
	Close()
}

type Tikv

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

func (*Tikv) Close

func (t *Tikv) Close()

func (*Tikv) ExclusiveWrite added in v0.0.19

func (t *Tikv) ExclusiveWrite(ctx context.Context, keys ...[]byte) (Write, error)

func (*Tikv) Ping added in v0.0.13

func (t *Tikv) Ping() error

func (*Tikv) Read

func (t *Tikv) Read() Read

func (*Tikv) Write

func (t *Tikv) Write() Write

type TikvRead

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

func (*TikvRead) BatchGet added in v0.0.8

func (r *TikvRead) BatchGet(ctx context.Context, keys [][]byte) (map[string][]byte, error)

func (*TikvRead) Close

func (r *TikvRead) Close()

func (*TikvRead) Get

func (r *TikvRead) Get(ctx context.Context, key []byte) ([]byte, error)

func (*TikvRead) Iter

func (r *TikvRead) Iter(ctx context.Context, start []byte, end []byte) iter.Seq2[KeyAndValue, error]

func (*TikvRead) SetKeyOnly

func (r *TikvRead) SetKeyOnly(b bool)

type TikvWrite

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

func (*TikvWrite) BatchGet added in v0.0.8

func (r *TikvWrite) BatchGet(ctx context.Context, keys [][]byte) (map[string][]byte, error)

func (*TikvWrite) Close

func (r *TikvWrite) Close()

func (*TikvWrite) Commit

func (w *TikvWrite) Commit(ctx context.Context) error

func (*TikvWrite) Del

func (w *TikvWrite) Del(key []byte) error

func (*TikvWrite) Get

func (w *TikvWrite) Get(ctx context.Context, key []byte) ([]byte, error)

func (*TikvWrite) Iter

func (r *TikvWrite) Iter(ctx context.Context, start []byte, end []byte) iter.Seq2[KeyAndValue, error]

func (*TikvWrite) Put

func (w *TikvWrite) Put(key []byte, value []byte) error

func (*TikvWrite) Rollback

func (w *TikvWrite) Rollback() error

func (*TikvWrite) Stat added in v0.0.19

func (w *TikvWrite) Stat() (statLockRetries int)

type Write

type Write interface {
	Read
	Put(key []byte, value []byte) error
	Del(key []byte) error
	Commit(ctx context.Context) error
	Rollback() error
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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