Documentation
¶
Index ¶
- Variables
- func BenchmarkParallelGet()
- func BenchmarkParallelSet()
- func IsContextCanceled(err error) bool
- func IsEmptyList(err error) bool
- func IsInvalidKey(err error) bool
- func IsInvalidTTL(err error) bool
- func IsInvalidType(err error) bool
- func IsInvalidValueType(err error) bool
- func IsKeyExists(err error) bool
- func IsKeyExpired(err error) bool
- func IsKeyNotFound(err error) bool
- func IsTransactionFailed(err error) bool
- func IsTransactionNotActive(err error) bool
- func IsValueMismatch(err error) bool
- type APIHandler
- func (h *APIHandler) CloseAllSubscriptionsHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) DecrHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) DeleteHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) DropAllHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) ExistsHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) FindByValueHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) GetHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) GetSetHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) GetWithDetailsHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HDelHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HExistsHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HGetAllHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HGetHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HLenHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) HSetHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) IncrHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) LLenHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) LPopHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) LPushHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) LRangeHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) ListSubscriptionsHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) RPopHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) RPushHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) RenameHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) RunServer(port, prefix string, middlewares ...func(http.Handler) http.Handler)
- func (h *APIHandler) SetCASHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) SetHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) SetNXHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) SetXXHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) SubscribeHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) TypeHandler(w http.ResponseWriter, r *http.Request)
- func (h *APIHandler) UpdateTTLHandler(w http.ResponseWriter, r *http.Request)
- type CommandAPI
- type Config
- type DB
- func (db *DB) Close() error
- func (db *DB) CloseAllSubscriptionsForKey(key string)
- func (db *DB) Commands() contracts.CommandsHandler
- func (db *DB) Decr(ctx context.Context, key string) (int64, error)
- func (db *DB) Delete(ctx context.Context, key string) error
- func (db *DB) DropAll(ctx context.Context) error
- func (db *DB) Exists(ctx context.Context, key string) (bool, error)
- func (db *DB) FindByValue(ctx context.Context, value interface{}) ([]string, error)
- func (db *DB) Get(ctx context.Context, key string) (interface{}, error)
- func (db *DB) GetSet(ctx context.Context, key string, newValue interface{}, ttl int) (interface{}, error)
- func (db *DB) GetWithDetails(ctx context.Context, key string) (interface{}, int, error)
- func (db *DB) HDel(ctx context.Context, key string, field string) error
- func (db *DB) HExists(ctx context.Context, key string, field string) (bool, error)
- func (db *DB) HGet(ctx context.Context, key string, field string) (interface{}, error)
- func (db *DB) HGetAll(ctx context.Context, key string) (map[string]interface{}, error)
- func (db *DB) HLen(ctx context.Context, key string) (int, error)
- func (db *DB) HSet(ctx context.Context, key string, field string, value interface{}, ttl int) error
- func (db *DB) Incr(ctx context.Context, key string) (int64, error)
- func (db *DB) LLen(ctx context.Context, key string) (int, error)
- func (db *DB) LPop(ctx context.Context, key string) (interface{}, error)
- func (db *DB) LPush(ctx context.Context, key string, values ...interface{}) error
- func (db *DB) LRange(ctx context.Context, key string, start, end int) ([]interface{}, error)
- func (db *DB) ListSubscriptions() []string
- func (db *DB) Logger() contracts.LoggerHandler
- func (db *DB) RPop(ctx context.Context, key string) (interface{}, error)
- func (db *DB) RPush(ctx context.Context, key string, values ...interface{}) error
- func (db *DB) Rename(ctx context.Context, oldKey, newKey string) error
- func (db *DB) Set(ctx context.Context, key string, value interface{}, ttl int) error
- func (db *DB) SetCAS(ctx context.Context, key string, oldValue, newValue interface{}, ttl int) error
- func (db *DB) SetNX(ctx context.Context, key string, value interface{}, ttl int) (bool, error)
- func (db *DB) SetXX(ctx context.Context, key string, value interface{}, ttl int) (bool, error)
- func (db *DB) Subscribe(key string) chan string
- func (db *DB) Transaction() contracts.TransactionHandler
- func (db *DB) Type(ctx context.Context, key string) (interface{}, error)
- func (db *DB) Unsubscribe(key string, ch chan string)
- func (db *DB) UpdateTTL(ctx context.Context, key string, ttl int) error
- type DataType
- type Entry
- type Transaction
- func (t *Transaction) Commit() error
- func (t *Transaction) Decr(ctx context.Context, key string) error
- func (t *Transaction) Delete(ctx context.Context, key string) error
- func (t *Transaction) Exists(ctx context.Context, key string) (bool, error)
- func (t *Transaction) FindByValue(ctx context.Context, value interface{}) ([]string, error)
- func (t *Transaction) Get(ctx context.Context, key string) (interface{}, error)
- func (t *Transaction) GetSet(ctx context.Context, key string, newValue interface{}, ttl int) (interface{}, error)
- func (t *Transaction) GetWithDetails(ctx context.Context, key string) (interface{}, int, error)
- func (t *Transaction) HDel(ctx context.Context, key, field string) error
- func (t *Transaction) HExists(ctx context.Context, key, field string) (bool, error)
- func (t *Transaction) HGet(ctx context.Context, key, field string) (interface{}, error)
- func (t *Transaction) HGetAll(ctx context.Context, key string) (map[string]interface{}, error)
- func (t *Transaction) HLen(ctx context.Context, key string) (int, error)
- func (t *Transaction) HSet(ctx context.Context, key, field string, value interface{}, ttl int) error
- func (t *Transaction) Incr(ctx context.Context, key string) error
- func (t *Transaction) LLen(ctx context.Context, key string) (int, error)
- func (t *Transaction) LPop(ctx context.Context, key string) (interface{}, error)
- func (t *Transaction) LPush(ctx context.Context, key string, values ...interface{}) error
- func (t *Transaction) LRange(ctx context.Context, key string, start, end int) ([]interface{}, error)
- func (t *Transaction) RPop(ctx context.Context, key string) (interface{}, error)
- func (t *Transaction) RPush(ctx context.Context, key string, values ...interface{}) error
- func (t *Transaction) Rename(ctx context.Context, oldKey, newKey string) error
- func (t *Transaction) Rollback() error
- func (t *Transaction) Set(ctx context.Context, key string, value interface{}, ttl int) error
- func (t *Transaction) SetCAS(ctx context.Context, key string, oldValue, newValue interface{}, ttl int) error
- func (t *Transaction) SetNX(ctx context.Context, key string, value interface{}, ttl int) error
- func (t *Transaction) SetXX(ctx context.Context, key string, value interface{}, ttl int) error
- func (t *Transaction) Type(ctx context.Context, key string) (interface{}, error)
- func (t *Transaction) UpdateTTL(ctx context.Context, key string, ttl int) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrKeyNotFound = errors.New("key not found") ErrKeyExpired = errors.New("key expired") ErrKeyExists = errors.New("key already exists") ErrInvalidType = errors.New("invalid data type") ErrValueMismatch = errors.New("value mismatch") ErrInvalidValueType = errors.New("invalid value type") ErrContextCanceled = errors.New("operation canceled") ErrInvalidTTL = errors.New("invalid TTL value") ErrEmptyList = errors.New("list is empty") ErrEmptyValues = errors.New("empty value") ErrInvalidKey = errors.New("invalid key") ErrTransactionNotActive = errors.New("transaction is not active") ErrTransactionFailed = errors.New("transaction failed") )
Functions ¶
func BenchmarkParallelGet ¶
func BenchmarkParallelGet()
func BenchmarkParallelSet ¶
func BenchmarkParallelSet()
func IsContextCanceled ¶
func IsEmptyList ¶
func IsInvalidKey ¶
func IsInvalidTTL ¶
func IsInvalidType ¶
func IsInvalidValueType ¶
func IsKeyExists ¶
func IsKeyExpired ¶
func IsKeyNotFound ¶
func IsTransactionFailed ¶
func IsTransactionNotActive ¶
func IsValueMismatch ¶
Types ¶
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
func NewAPIHandler ¶
func NewAPIHandler(ctx context.Context, db contracts.StoreHandler) *APIHandler
func (*APIHandler) CloseAllSubscriptionsHandler ¶
func (h *APIHandler) CloseAllSubscriptionsHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) DecrHandler ¶
func (h *APIHandler) DecrHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) DeleteHandler ¶
func (h *APIHandler) DeleteHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) DropAllHandler ¶
func (h *APIHandler) DropAllHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) ExistsHandler ¶
func (h *APIHandler) ExistsHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) FindByValueHandler ¶
func (h *APIHandler) FindByValueHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) GetHandler ¶
func (h *APIHandler) GetHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) GetSetHandler ¶
func (h *APIHandler) GetSetHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) GetWithDetailsHandler ¶
func (h *APIHandler) GetWithDetailsHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) HDelHandler ¶
func (h *APIHandler) HDelHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) HExistsHandler ¶
func (h *APIHandler) HExistsHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) HGetAllHandler ¶
func (h *APIHandler) HGetAllHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) HGetHandler ¶
func (h *APIHandler) HGetHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) HLenHandler ¶
func (h *APIHandler) HLenHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) HSetHandler ¶
func (h *APIHandler) HSetHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) IncrHandler ¶
func (h *APIHandler) IncrHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) LLenHandler ¶
func (h *APIHandler) LLenHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) LPopHandler ¶
func (h *APIHandler) LPopHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) LPushHandler ¶
func (h *APIHandler) LPushHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) LRangeHandler ¶
func (h *APIHandler) LRangeHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) ListSubscriptionsHandler ¶
func (h *APIHandler) ListSubscriptionsHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) RPopHandler ¶
func (h *APIHandler) RPopHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) RPushHandler ¶
func (h *APIHandler) RPushHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) RenameHandler ¶
func (h *APIHandler) RenameHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) SetCASHandler ¶
func (h *APIHandler) SetCASHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) SetHandler ¶
func (h *APIHandler) SetHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) SetNXHandler ¶
func (h *APIHandler) SetNXHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) SetXXHandler ¶
func (h *APIHandler) SetXXHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) SubscribeHandler ¶
func (h *APIHandler) SubscribeHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) TypeHandler ¶
func (h *APIHandler) TypeHandler(w http.ResponseWriter, r *http.Request)
func (*APIHandler) UpdateTTLHandler ¶
func (h *APIHandler) UpdateTTLHandler(w http.ResponseWriter, r *http.Request)
type CommandAPI ¶
type CommandAPI struct {
// contains filtered or unexported fields
}
func NewCommandAPI ¶
func NewCommandAPI(db contracts.StoreHandler) *CommandAPI
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) CloseAllSubscriptionsForKey ¶
func (*DB) Commands ¶
func (db *DB) Commands() contracts.CommandsHandler
func (*DB) FindByValue ¶
func (*DB) GetWithDetails ¶
func (*DB) ListSubscriptions ¶
func (*DB) Logger ¶
func (db *DB) Logger() contracts.LoggerHandler
func (*DB) Transaction ¶
func (db *DB) Transaction() contracts.TransactionHandler
func (*DB) Unsubscribe ¶
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction(db contracts.StoreHandler) *Transaction
func (*Transaction) Commit ¶
func (t *Transaction) Commit() error
func (*Transaction) FindByValue ¶
func (t *Transaction) FindByValue(ctx context.Context, value interface{}) ([]string, error)
func (*Transaction) Get ¶
func (t *Transaction) Get(ctx context.Context, key string) (interface{}, error)
func (*Transaction) GetWithDetails ¶
func (*Transaction) HGet ¶
func (t *Transaction) HGet(ctx context.Context, key, field string) (interface{}, error)
func (*Transaction) LPop ¶
func (t *Transaction) LPop(ctx context.Context, key string) (interface{}, error)
func (*Transaction) LPush ¶
func (t *Transaction) LPush(ctx context.Context, key string, values ...interface{}) error
func (*Transaction) RPop ¶
func (t *Transaction) RPop(ctx context.Context, key string) (interface{}, error)
func (*Transaction) RPush ¶
func (t *Transaction) RPush(ctx context.Context, key string, values ...interface{}) error
func (*Transaction) Rename ¶
func (t *Transaction) Rename(ctx context.Context, oldKey, newKey string) error
func (*Transaction) Rollback ¶
func (t *Transaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.