Documentation ¶
Index ¶
- Variables
- func IsNotFound(err error) bool
- type ClientConfig
- type GrpcClient
- func (c *GrpcClient) CacheGet(key string) (string, error)
- func (c *GrpcClient) CacheSet(key, value string, ttl int32) error
- func (c *GrpcClient) CounterGet(key string) (int64, error)
- func (c *GrpcClient) CounterIncrement(key string, amount int64) error
- func (c *GrpcClient) KVDelete(key string) error
- func (c *GrpcClient) KVGet(key string) (*kv.Value, error)
- func (c *GrpcClient) KVPut(key string, value *kv.Value) error
- func (c *GrpcClient) SetAdd(set, item string) ([]string, error)
- func (c *GrpcClient) SetGet(set string) ([]string, error)
- func (c *GrpcClient) SetRemove(set, item string) ([]string, error)
- type HttpClient
- func (c *HttpClient) CacheGet(key string) (string, error)
- func (c *HttpClient) CacheSet(key, value string, ttl int32) error
- func (c *HttpClient) CounterGet(key string) (int64, error)
- func (c *HttpClient) CounterIncrement(key string, increment int64) error
- func (c *HttpClient) FlagGet(key string) (bool, error)
- func (c *HttpClient) FlagSet(key string, value bool) error
- func (c *HttpClient) KVDelete(key string) error
- func (c *HttpClient) KVGet(key string) (*kv.Value, error)
- func (c *HttpClient) KVPut(key string, value *kv.Value) error
- func (c *HttpClient) SetAdd(key, item string) ([]string, error)
- func (c *HttpClient) SetGet(key string) ([]string, error)
- func (c *HttpClient) SetRemove(key, item string) ([]string, error)
- type NotFoundError
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoKey = errors.New("no resource key provided") ErrNoValue = errors.New("no value provided") ErrNoAddress = errors.New("no server address provided") ErrNoPort = errors.New("no server port provided") ErrPortOutOfRange = errors.New("port must be between 1024 and 49151") ErrBackendNotRecognized = errors.New("backend key not recognized") ErrNoBackend = errors.New("no backend specified") )
Functions ¶
func IsNotFound ¶
Types ¶
type ClientConfig ¶
type ClientConfig struct {
Address string
}
func (*ClientConfig) Validate ¶
func (c *ClientConfig) Validate() error
type GrpcClient ¶ added in v0.1.2
type GrpcClient struct {
// contains filtered or unexported fields
}
func NewGrpcClient ¶ added in v0.1.2
func NewGrpcClient(cfg *ClientConfig) (*GrpcClient, error)
func (*GrpcClient) CacheGet ¶ added in v0.1.2
func (c *GrpcClient) CacheGet(key string) (string, error)
Cache
func (*GrpcClient) CacheSet ¶ added in v0.1.2
func (c *GrpcClient) CacheSet(key, value string, ttl int32) error
func (*GrpcClient) CounterGet ¶ added in v0.1.2
func (c *GrpcClient) CounterGet(key string) (int64, error)
Counter
func (*GrpcClient) CounterIncrement ¶ added in v0.1.2
func (c *GrpcClient) CounterIncrement(key string, amount int64) error
func (*GrpcClient) KVDelete ¶ added in v0.1.2
func (c *GrpcClient) KVDelete(key string) error
func (*GrpcClient) KVGet ¶ added in v0.1.2
func (c *GrpcClient) KVGet(key string) (*kv.Value, error)
KV
func (*GrpcClient) KVPut ¶ added in v0.1.2
func (c *GrpcClient) KVPut(key string, value *kv.Value) error
func (*GrpcClient) SetAdd ¶ added in v0.1.2
func (c *GrpcClient) SetAdd(set, item string) ([]string, error)
type HttpClient ¶ added in v0.1.2
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶ added in v0.1.2
func NewHttpClient(cfg *ClientConfig) (*HttpClient, error)
func (*HttpClient) CacheGet ¶ added in v0.1.2
func (c *HttpClient) CacheGet(key string) (string, error)
Cache operations
func (*HttpClient) CacheSet ¶ added in v0.1.2
func (c *HttpClient) CacheSet(key, value string, ttl int32) error
func (*HttpClient) CounterGet ¶ added in v0.1.2
func (c *HttpClient) CounterGet(key string) (int64, error)
Counter operations
func (*HttpClient) CounterIncrement ¶ added in v0.1.2
func (c *HttpClient) CounterIncrement(key string, increment int64) error
func (*HttpClient) FlagSet ¶ added in v0.1.3
func (c *HttpClient) FlagSet(key string, value bool) error
func (*HttpClient) KVDelete ¶ added in v0.1.2
func (c *HttpClient) KVDelete(key string) error
func (*HttpClient) KVGet ¶ added in v0.1.2
func (c *HttpClient) KVGet(key string) (*kv.Value, error)
KV operations
func (*HttpClient) KVPut ¶ added in v0.1.2
func (c *HttpClient) KVPut(key string, value *kv.Value) error
func (*HttpClient) SetAdd ¶ added in v0.1.2
func (c *HttpClient) SetAdd(key, item string) ([]string, error)
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
func NotFound ¶
func NotFound(key string) NotFoundError
func (NotFoundError) AsProtoStatus ¶
func (e NotFoundError) AsProtoStatus() error
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type ServerConfig ¶
func (*ServerConfig) Validate ¶
func (c *ServerConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.