Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultNamespace = "RedQueen"
DefaultNamespace = ""
)
Variables ¶
View Source
var ( ErrKeyAlreadyExists = errors.New("key already exists") ErrKeyNotFound = errors.New("key not found") )
Functions ¶
Types ¶
type Actions ¶
type Actions interface { Current() string Get(key []byte) (value *Value, err error) PrefixSearchScan(prefix []byte, reg string, offset, limit int) ([]*Value, error) PrefixScan(prefix []byte, offset, limit int) ([]*Value, error) SetWithTTL(key, value []byte, ttl uint32) error TrySetWithTTL(key, value []byte, ttl uint32) error Set(key, value []byte) error // TrySet try to set a key-value, returns an error if the key already exists TrySet(key, value []byte) error Del(key []byte) error Watch(key []byte) (notify Watcher, err error) WatchPrefix(prefix []byte) Watcher }
type WatchValue ¶
type WatchValue struct { Seq uint64 Timestamp int64 TTL uint32 Key []byte // Value can be nil pointer, if Value is nil pointer then that the Value is deleted Value *[]byte }
func (*WatchValue) Deleted ¶
func (v *WatchValue) Deleted() bool
type Watcher ¶
type Watcher interface { Notify() chan *WatchValue Close() error }
Click to show internal directories.
Click to hide internal directories.