store

package
v0.0.0-...-7c81865 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreOpPut = 0
	StoreOpDel = 1
	StoreOpAll = 2
	OpRetry    = 3
)

Variables

View Source
var (
	ErrObjNotExist = fmt.Errorf("obj not exist")
)

Functions

This section is empty.

Types

type ChangeWatcher

type ChangeWatcher func(interface{}, OpType, string, []byte, int64)

type KVPair

type KVPair struct {
	Key     string
	Val     []byte
	Version int64
}

Store is a kv store with version control. VersionChangeWatcher is used to update version info

type OpType

type OpType int32

type StoreEngine

type StoreEngine interface {
	Get(string) ([]*KVPair, error)
	Del(key string) error
	CAS(string, int64, []byte) (int64, error)
	RegisterWatcher(param interface{}, key string, watcher ChangeWatcher, op OpType)
	SetWithRelease(string, []byte, time.Duration, bool) error
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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