Documentation ¶
Index ¶
- Constants
- func CategoriesKey(category string) string
- func CategoryKey(category string) string
- func GenerateKey(keys ...string) string
- func RedisClientConfigTypeLive() *dot.ConfigTypeLive
- func RedisClientTypeLives() []*dot.TypeLives
- func VersionItemKey(category string, version string, itemKey string) string
- func VersionKey(category string, version string) string
- type Operation
- type RedisClient
- func (c *RedisClient) AfterAllDestroy(_ dot.Line)
- func (c *RedisClient) CleanVersion(category string, version string) error
- func (c *RedisClient) ClientV8() *redis.Client
- func (c *RedisClient) Create(dot.Line) error
- func (c *RedisClient) Del(category, version, itemKey string) (int64, error)
- func (c *RedisClient) Get(category, version, itemKey string) (string, error)
- func (c *RedisClient) GetJsonSerialize(category, version, itemKey string, value interface{}) error
- func (c *RedisClient) GetVersion(category string) (string, error)
- func (c *RedisClient) GetVersions(category string) ([]string, error)
- func (c *RedisClient) Set(category, version, itemKey, value string, expiration time.Duration) (string, error)
- func (c *RedisClient) SetJsonSerialize(category, version, itemKey string, value interface{}, expiration time.Duration) (string, error)
- func (c *RedisClient) SetVersion(category, version string) error
- type VersionControl
Constants ¶
View Source
const ( //VersionControlChannelName Version Control Channel Name VersionControlChannelName = "version_control" //KeySplitChar Key Split Char KeySplitChar = ":" //CategoryPrefix Category Prefix CategoryPrefix = "CV" //CategoriesPrefix Categories Prefix CategoriesPrefix = "CVS" )
View Source
const RedisClientTypeID = "0ae35550-7e37-4afe-866e-b129099759b7"
RedisClientTypeID type id
Variables ¶
This section is empty.
Functions ¶
func RedisClientConfigTypeLive ¶ added in v0.2.1
func RedisClientConfigTypeLive() *dot.ConfigTypeLive
RedisClientConfigTypeLive return config
func RedisClientTypeLives ¶
RedisClientTypeLives return type lives
func VersionItemKey ¶
VersionItemKey use category,version,item key to generate key of redis
Types ¶
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
RedisClient redis client dot
func RedisClientTest ¶
func RedisClientTest(jsonConfig string) *RedisClient
RedisClientTest for test
func (*RedisClient) AfterAllDestroy ¶
func (c *RedisClient) AfterAllDestroy(_ dot.Line)
AfterAllDestroy after all destroy
func (*RedisClient) CleanVersion ¶
func (c *RedisClient) CleanVersion(category string, version string) error
CleanVersion del versions in key
func (*RedisClient) ClientV8 ¶
func (c *RedisClient) ClientV8() *redis.Client
ClientV8 return redis.Client
func (*RedisClient) Del ¶
func (c *RedisClient) Del(category, version, itemKey string) (int64, error)
Del del key
func (*RedisClient) Get ¶
func (c *RedisClient) Get(category, version, itemKey string) (string, error)
Get get value
func (*RedisClient) GetJsonSerialize ¶
func (c *RedisClient) GetJsonSerialize(category, version, itemKey string, value interface{}) error
Get get value
func (*RedisClient) GetVersion ¶
func (c *RedisClient) GetVersion(category string) (string, error)
GetVersion get current version by category, return version and error.
func (*RedisClient) GetVersions ¶
func (c *RedisClient) GetVersions(category string) ([]string, error)
GetVersions return versions (dictionary order)
func (*RedisClient) Set ¶
func (c *RedisClient) Set(category, version, itemKey, value string, expiration time.Duration) (string, error)
Set set value
func (*RedisClient) SetJsonSerialize ¶
func (c *RedisClient) SetJsonSerialize(category, version, itemKey string, value interface{}, expiration time.Duration) (string, error)
Set set value
func (*RedisClient) SetVersion ¶
func (c *RedisClient) SetVersion(category, version string) error
SetVersion set version for category
type VersionControl ¶
type VersionControl struct { // Op indicates the operation of the update. Op Operation `json:"op"` Key string `json:"key"` Version string `json:"version"` }
VersionControl defines a version edit.
func (*VersionControl) Unmarshal ¶
func (c *VersionControl) Unmarshal(jsonStr string) (*VersionControl, error)
Unmarshal json string to VersionControl
Click to show internal directories.
Click to hide internal directories.