memds

package
v0.0.0-...-40d8b2c Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorCodeCommandDecodeError   = 100
	ErrorCodeCommandFormatError   = 200
	ErrorCodeCommandNotFoundError = 300
	ErrorCodeCommandExecuteError  = 400
)

Variables

View Source
var (
	BucketsLEZeroError   = errors.New("bucket num can't le 0")
	BucketNotFoundError  = errors.New("bucket not found")
	ValueNotFoundError   = errors.New("value not found")
	CommandNotFoundError = errors.New("command not found")
)

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

func Del

func Del(k string) error

func Error

func Error(msg string, fields ...zap.Field)

func Exec

func Exec(b []byte) []byte

func Get

func Get(k string) (interface{}, error)

func Info

func Info(msg string, fields ...zap.Field)

func Serve

func Serve(c *Config) error

func Set

func Set(k string, v interface{}) error

func Uint8ArrayToString

func Uint8ArrayToString(a []uint8) string

func Warn

func Warn(msg string, fields ...zap.Field)

Types

type Bucket

type Bucket struct {
	// contains filtered or unexported fields
}

func (*Bucket) Del

func (b *Bucket) Del(k string)

func (*Bucket) Get

func (b *Bucket) Get(k string) (interface{}, error)

func (*Bucket) Set

func (b *Bucket) Set(k string, v interface{}) error

type Buckets

type Buckets []*Bucket

func NewBuckets

func NewBuckets(n int) (Buckets, error)

func (Buckets) Get

func (b Buckets) Get(k string) *Bucket

func (Buckets) Len

func (b Buckets) Len() int

type Config

type Config struct {
	Port      int    `toml:"port"`
	Sock      string `toml:"sock"`
	BucketNum int    `toml:"bucket_num"`
}

func LoadConfig

func LoadConfig(p string) (*Config, error)

Jump to

Keyboard shortcuts

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