Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Version - library/server version Version = "0.1" // DefaultHost - host for server DefaultHost = "localhost" // DefaultPort - port for server DefaultPort = "8771" // MaxStringValueLength - string value max length MaxStringValueLength = 1024 * 1024 // 1 MB )
Variables ¶
View Source
var ( ErrBadRequest = RaphError{1, "Bad request"} ErrKeyNotExists = RaphError{2, "Key not exists"} ErrKeyTypeMissmatch = RaphError{3, "The type does not match"} ErrListOutOfRange = RaphError{4, "List index is out of range"} ErrDictKeyNotExists = RaphError{5, "Dict, key not exists"} ErrDictKeyIsEmpty = RaphError{6, "Key or dict key is empty"} ErrTTLIsntCorrect = RaphError{7, "TTL parameter isn't correct"} ErrKeyIsNotValid = RaphError{8, "Key is not valid"} )
Common errors
Functions ¶
This section is empty.
Types ¶
type OutputCommon ¶
type OutputCommon struct {
ErrorCode int `json:"error_code"`
ErrorMessage string `json:"error_message,omitempty"`
}
OutputCommon - common part of all responses
type OutputGetDict ¶
type OutputGetDict struct {
OutputCommon
ValueDict DictValue `json:"value_dict"`
}
OutputGetDict - output for /dict/:key
type OutputGetInt ¶
type OutputGetInt struct {
OutputCommon
ValueInt int64 `json:"value_int"`
}
OutputGetInt - output for /int/:key
type OutputGetList ¶
type OutputGetList struct {
OutputCommon
ValueList ListValue `json:"value_list"`
}
OutputGetList - output for /list/:key
type OutputGetStr ¶
type OutputGetStr struct {
OutputCommon
ValueStr string `json:"value_str"`
}
OutputGetStr - output for /str/:key
type OutputKeys ¶
type OutputKeys struct {
OutputCommon
Keys []string `json:"keys"`
}
OutputKeys - output for /keys
type OutputLength ¶
type OutputLength struct {
OutputCommon
Length int `json:"length"`
}
OutputLength - output for /length
type Stat ¶
type Stat struct {
Version string `json:"version"`
MemAlloc uint64 `json:"mem_alloc"`
MemTotalAlloc uint64 `json:"mem_total_alloc"`
MemMallocs uint64 `json:"mem_malloc"`
MemFrees uint64 `json:"mem_frees"`
MemHeapObjects uint64 `json:"mem_heap_objects"`
GCPauseTotalNs uint64 `json:"gc_pause_total_ns"`
}
Stat - some stat: version, memory, GC, etc
Click to show internal directories.
Click to hide internal directories.