Documentation ¶
Index ¶
Constants ¶
View Source
const B64JSONPrefix = "ey"
B64JSONPrefix stand for `{"` in base64.
View Source
const (
HashSha256 = "sha256"
)
Variables ¶
View Source
var ErrKeyNotFound = errors.New("key not found")
ErrKeyNotFound is a standard error for when a key is not found in the storage engine.
Functions ¶
func InitInstance ¶
InitInstance initialize the redis cluster client.
Types ¶
type Options ¶
type Options struct { Addrs []string `json:"addrs" mapstructure:"addrs"` Username string `json:"username" mapstructure:"username"` Password string `json:"password" mapstructure:"password"` Database int `json:"database" mapstructure:"database"` MasterName string `json:"master-name" mapstructure:"master-name"` EnableCluster bool `json:"enable-cluster" mapstructure:"enable-cluster"` PoolSize int `json:"pool-size" mapstructure:"pool-size"` DialTimeout time.Duration `json:"dial-timeout" mapstructure:"dial-timeout"` RequestTimeout time.Duration `json:"request-timeout" mapstructure:"request-timeout"` TLS TLSOptions `json:"tls" mapstructure:"tls"` }
Options defines options for redis cluster.
type Store ¶
type Store interface { GetKey(string) (string, error) // Returned string is expected to be a JSON object (user.SessionState) GetMultiKey([]string) ([]string, error) GetRawKey(string) (string, error) SetKey( string, string, time.Duration, ) error // Second input string is expected to be a JSON object (user.SessionState) SetRawKey(string, string, time.Duration) error SetExp(string, time.Duration) error // Set key expiration GetExp(string) (time.Duration, error) // Returns expiry of a key GetKeys(string) []string DeleteKey(string) bool DeleteAllKeys() bool DeleteRawKey(string) bool GetKeysAndValues() map[string]string GetKeysAndValuesWithFilter(string) map[string]string DeleteKeys([]string) bool Decrement(string) IncrememntWithExpire(string, time.Duration) int64 SetRollingWindow(key string, per int64, val string, pipeline bool) (int, []interface{}) GetRollingWindow(key string, per int64, pipeline bool) (int, []interface{}) GetSet(string) (map[string]string, error) AddToSet(string, string) GetAndDeleteSet(string) []interface{} RemoveFromSet(string, string) DeleteScanMatch(string) bool GetKeyPrefix() string AddToSortedSet(string, string, float64) GetSortedSetRange(string, string, string) ([]string, []float64, error) RemoveSortedSetRange(string, string, string) error GetListRange(string, int64, int64) ([]string, error) RemoveFromList(string, string) error AppendToSet(string, string) Exists(string) (bool, error) }
Store is the store interface of redis engine.
type TLSOptions ¶
type TLSOptions struct { Enabled bool `json:"enabled" mapstructure:"enabled"` // CertFile is a file containing a PEM-encoded certificate, and possibly the complete certificate chain CertFile string `json:"cert-file" mapstructure:"cert-file"` // KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile KeyFile string `json:"private-key-file" mapstructure:"private-key-file"` }
TLSOptions contains configuration for TLS.
Click to show internal directories.
Click to hide internal directories.