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 Base ¶
type Base interface {
GetNamespace() string
Get(key []byte) (value *Value, err 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 WatcherNotify, err error)
}
type WatchValue ¶
type WatchValue struct {
Seq uint64
Timestamp int64
// Data can be nil pointer, if Data is nil pointer then that the Data is deleted
Data *[]byte
}
func (*WatchValue) Deleted ¶
func (v *WatchValue) Deleted() bool
type WatcherNotify ¶
type WatcherNotify interface {
Notify() chan *WatchValue
Close() error
}
Click to show internal directories.
Click to hide internal directories.