Documentation
¶
Index ¶
- Constants
- Variables
- func DataKey(namespace, name []byte) []byte
- func EncodeObject(obj *Object) []byte
- func EncodePubsubMeta(meta *PubsubMeta) []byte
- func EscapeKey(key string) []byte
- func Int64FromBytes(data []byte) int64
- func Int64ToBytes(val int64) []byte
- func IsErrEmpty(err error) bool
- func IsErrNotFound(err error) bool
- func MetaKey(namespace, name []byte) []byte
- func Unescape(key []byte) (string, error)
- type Data
- type GC
- type HashMap
- type KvMeta
- type Object
- type ObjectType
- type Pubsub
- type PubsubMeta
- type ScanHandler
- type SysGC
- type TikvGC
Constants ¶
View Source
const ( ObjectQueue = ObjectType(iota) ObjectHashMap ObjectPubsub ObjectEncodeLen = 17 ObjectEncodeIdLen = 16 )
Variables ¶
View Source
var ( ErrNotFound = kv.ErrNotExist ErrInvalidKey = errors.New("invalid key") ErrInvalid = errors.New("invalid argument") ErrEmpty = errors.New("empty") )
Functions ¶
func EncodeObject ¶
func EncodePubsubMeta ¶
func EncodePubsubMeta(meta *PubsubMeta) []byte
EncodePubsubMeta encode the meta of a pubsub
func Int64FromBytes ¶
func Int64ToBytes ¶
func IsErrEmpty ¶
func IsErrNotFound ¶
Types ¶
type HashMap ¶
type HashMap interface { Get(key string) ([]byte, error) Delete(key string) error Destroy() error Exists() bool GetAll() (map[string][]byte, error) Set(key string, val []byte) error }
func NewHashMap ¶
type Object ¶
type Object struct { ID []byte Type ObjectType }
func DecodeObject ¶
func NewObject ¶
func NewObject(ty ObjectType) *Object
type ObjectType ¶
type ObjectType byte
type Pubsub ¶
type Pubsub struct {
// contains filtered or unexported fields
}
Pubsub is the meta of a pubsub
func NewPubsub ¶
func NewPubsub(txn kv.Transaction, ns, name, usage string) (*Pubsub, error)
NewPubsub creates a pubsub, if the pubsub has existed, return it
func (*Pubsub) DeleteIndex ¶
DeleteIndex delete pubsub index
type PubsubMeta ¶
type PubsubMeta struct {
*Object
}
PubsubMeta is the meta of a pubsub
func DecodePubsubMeta ¶
func DecodePubsubMeta(b []byte) (*PubsubMeta, error)
DecodePubsubMeta decode the meta of a pubsub
type ScanHandler ¶
ScanHandler is a handler to process scanned messages
Click to show internal directories.
Click to hide internal directories.