kv

package
v0.0.0-...-9789875 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelArgs

type DelArgs GetArgs

type GetArgs

type GetArgs struct {
	Key string
}

type IncrArgs

type IncrArgs struct {
	Key   string
	Delta int
}

type KVStore

type KVStore interface {
	Get(key string) (value string, existed bool)
	Put(key string, value string) (oldValue string, existed bool)
	Incr(key string, delta int) (oldValue string, existed bool, err error)
	Del(key string) (oldValue string, existed bool)
}

KVStore is the embeded KV-store.

type KVStoreService

type KVStoreService interface {
	KVStore
	RPCPut(args *PutArgs, reply *Reply) error
	RPCGet(args *GetArgs, reply *Reply) error
	RPCIncr(args *IncrArgs, reply *Reply) (err error)
	RPCDel(args *DelArgs, reply *Reply) (err error)
}

KVStoreService is a service wrapping a KVStore.

type PutArgs

type PutArgs struct {
	Key   string
	Value string
}

type Reply

type Reply struct {
	Flag  bool
	Value string
}

Jump to

Keyboard shortcuts

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