Documentation ¶
Index ¶
- Variables
- func InitLog() error
- func Main()
- type IRpcServer
- type IStorage
- type KVItem
- type RpcServer
- func (this *RpcServer) Delete(ctx context.Context, arg *proto.DelOptArg) (*proto.DelOptRet, error)
- func (this *RpcServer) Get(ctx context.Context, arg *proto.GetOptArg) (*proto.GetOptRet, error)
- func (this *RpcServer) Run() error
- func (this *RpcServer) Set(ctx context.Context, arg *proto.SetOptArg) (*proto.SetOptRet, error)
- func (this *RpcServer) Stop() (err error)
- type Storage
- type StorageManager
Constants ¶
This section is empty.
Variables ¶
View Source
var EXPIRED_ERROR error = errors.New("Expire error")
View Source
var KEY_NOT_EXIST_ERROR error = errors.New("Key not exist error")
View Source
var OUT_OF_MEMORY_LIMIT_ERROR error = errors.New("Out of memory limit error")
Functions ¶
Types ¶
type IRpcServer ¶
func NewRpcServer ¶
func NewRpcServer(addr string, storage IStorage) IRpcServer
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
type StorageManager ¶
type StorageManager struct {
// contains filtered or unexported fields
}
The implementation of IStorage
func NewStorageManager ¶
func NewStorageManager(bucketNum int, memoryLimit int64, cleanInterval time.Duration) *StorageManager
memoryLimit unit is in byte
func (*StorageManager) Delete ¶
func (this *StorageManager) Delete(key string) error
func (*StorageManager) Run ¶
func (this *StorageManager) Run()
func (*StorageManager) Stop ¶
func (this *StorageManager) Stop()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.