Documentation
¶
Overview ¶
package do stands for data options
Index ¶
- func ConcatedKeys(fields ...interface{}) string
- type Ctx
- func (db *Ctx[k, v]) AddBloomKey(key k) (err error)
- func (db *Ctx[k, v]) BLPop(timeout time.Duration) (ret v, err error)
- func (db *Ctx[k, v]) BRPop(timeout time.Duration) (ret v, err error)
- func (db *Ctx[k, v]) BRPopLPush(destination string, timeout time.Duration) (ret v, err error)
- func (db *Ctx[k, v]) BuildBloomFilterByKeys(keys []string, capacity int, falsePosition float64) (err error)
- func (db *Ctx[k, v]) BuildBloomFilterHKeys(capacity int, falsePosition float64) (err error)
- func (db *Ctx[k, v]) Concat(fields ...interface{}) *Ctx[k, v]
- func (db *Ctx[k, v]) Del(key k) (err error)
- func (db *Ctx[k, v]) Get(key k) (value v, err error)
- func (db *Ctx[k, v]) GetAll(match string) (mapOut map[k]v, err error)
- func (db *Ctx[k, v]) HDel(fields ...k) (err error)
- func (db *Ctx[k, v]) HExists(field k) (ok bool, err error)
- func (db *Ctx[k, v]) HGet(field k) (value v, err error)
- func (db *Ctx[k, v]) HGetAll() (mapOut map[k]v, err error)
- func (db *Ctx[k, v]) HIncrBy(field k, increment int64) (err error)
- func (db *Ctx[k, v]) HIncrByFloat(field k, increment float64) (err error)
- func (db *Ctx[k, v]) HKeys() (fields []k, err error)
- func (db *Ctx[k, v]) HLen() (length int64, err error)
- func (db *Ctx[k, v]) HMGET(fields ...k) (values []v, err error)
- func (db *Ctx[k, v]) HRandField(count int) (fields []k, err error)
- func (db *Ctx[k, v]) HSet(values ...interface{}) (err error)
- func (db *Ctx[k, v]) HSetNX(field k, value v) (err error)
- func (db *Ctx[k, v]) HVals() (values []v, err error)
- func (db *Ctx[k, v]) Keys() (out []k, err error)
- func (db *Ctx[k, v]) LIndex(index int64) (ret v, err error)
- func (db *Ctx[k, v]) LInsertAfter(pivot, param v) (err error)
- func (db *Ctx[k, v]) LInsertBefore(pivot, param v) (err error)
- func (db *Ctx[k, v]) LLen() (length int64, err error)
- func (db *Ctx[k, v]) LPop() (ret v, err error)
- func (db *Ctx[k, v]) LPush(param ...v) (err error)
- func (db *Ctx[k, v]) LRange(start, stop int64) (ret []v, err error)
- func (db *Ctx[k, v]) LRem(count int64, param v) (err error)
- func (db *Ctx[k, v]) LSet(index int64, param v) (err error)
- func (db *Ctx[k, v]) LTrim(start, stop int64) (err error)
- func (db *Ctx[k, v]) RPop() (ret v, err error)
- func (db *Ctx[k, v]) RPush(param ...v) (err error)
- func (db *Ctx[k, v]) SAdd(param v) (err error)
- func (db *Ctx[k, v]) SIsMember(param v) (isMember bool, err error)
- func (db *Ctx[k, v]) SMembers() (members []v, err error)
- func (db *Ctx[k, v]) SRem(param v) (err error)
- func (db *Ctx[k, v]) Scan(match string, cursor uint64, count int64) (keys []string, err error)
- func (db *Ctx[k, v]) Set(key k, param v, expiration time.Duration) (err error)
- func (db *Ctx[k, v]) SetAll(_map map[k]v) (err error)
- func (db *Ctx[k, v]) Sort(sort *redis.Sort) (ret []v, err error)
- func (db *Ctx[k, v]) TestHKey(key k) (exist bool)
- func (db *Ctx[k, v]) TestKey(key k) (exist bool)
- func (db *Ctx[k, v]) Time() (tm time.Time, err error)
- func (db *Ctx[k, v]) UnmarshalRedisZ(members []redis.Z) (out []v, scores []float64, err error)
- func (db *Ctx[k, v]) UnmarshalToSlice(members []string) (out []v, err error)
- func (db *Ctx[k, v]) UpgradeSchema(upgrader func(in v) (out v)) (err error)
- func (db *Ctx[k, v]) Y(tm time.Time) *Ctx[k, v]
- func (db *Ctx[k, v]) YM(tm time.Time) *Ctx[k, v]
- func (db *Ctx[k, v]) YMD(tm time.Time) *Ctx[k, v]
- func (db *Ctx[k, v]) YW(tm time.Time) *Ctx[k, v]
- func (db *Ctx[k, v]) ZAdd(members ...redis.Z) (err error)
- func (db *Ctx[k, v]) ZCard() (length int64, err error)
- func (db *Ctx[k, v]) ZCount(min, max string) (length int64, err error)
- func (db *Ctx[k, v]) ZIncrBy(increment float64, member interface{}) (err error)
- func (db *Ctx[k, v]) ZLexCount(min, max string) (length int64)
- func (db *Ctx[k, v]) ZPopMax(count int64) (out []v, scores []float64, err error)
- func (db *Ctx[k, v]) ZPopMin(count int64) (out []v, scores []float64, err error)
- func (db *Ctx[k, v]) ZRange(start, stop int64) (members []v, err error)
- func (db *Ctx[k, v]) ZRangeByScore(opt *redis.ZRangeBy) (out []v, err error)
- func (db *Ctx[k, v]) ZRangeByScoreWithScores(opt *redis.ZRangeBy) (out []v, scores []float64, err error)
- func (db *Ctx[k, v]) ZRangeWithScores(start, stop int64) (members []v, scores []float64, err error)
- func (db *Ctx[k, v]) ZRank(member interface{}) (rank int64, err error)
- func (db *Ctx[k, v]) ZRem(members ...interface{}) (err error)
- func (db *Ctx[k, v]) ZRemRangeByRank(start, stop int64) (err error)
- func (db *Ctx[k, v]) ZRemRangeByScore(min, max string) (err error)
- func (db *Ctx[k, v]) ZRevRange(start, stop int64) (out []v, err error)
- func (db *Ctx[k, v]) ZRevRangeByScore(opt *redis.ZRangeBy) (out []v, err error)
- func (db *Ctx[k, v]) ZRevRangeByScoreWithScores(opt *redis.ZRangeBy) (out []v, scores []float64, err error)
- func (db *Ctx[k, v]) ZRevRangeWithScores(start, stop int64) (members []v, scores []float64, err error)
- func (db *Ctx[k, v]) ZRevRank(member interface{}) (rank int64, err error)
- func (db *Ctx[k, v]) ZScan(cursor uint64, match string, count int64) ([]string, uint64, error)
- func (db *Ctx[k, v]) ZScore(member interface{}) (score float64, err error)
- type DataOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConcatedKeys ¶
func ConcatedKeys(fields ...interface{}) string
Types ¶
type Ctx ¶
type Ctx[k comparable, v any] struct { Ctx context.Context Rds *redis.Client Key string BloomFilterKeys *bloom.BloomFilter }
func New ¶
func New[k comparable, v any](ops ...*DataOption) *Ctx[k, v]
func (*Ctx[k, v]) AddBloomKey ¶
func (*Ctx[k, v]) BRPopLPush ¶
func (*Ctx[k, v]) BuildBloomFilterByKeys ¶
func (*Ctx[k, v]) BuildBloomFilterHKeys ¶
func (*Ctx[k, v]) Del ¶
for the reason of protection, both db.Key & Key are required. the avoid set Hash table to the wrong type , and thus leading to data loss.
func (*Ctx[k, v]) HIncrByFloat ¶
func (*Ctx[k, v]) HRandField ¶
func (*Ctx[k, v]) HSet ¶
HSet accepts values in following formats:
HSet("myhash", "key1", "value1", "key2", "value2")
HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
func (*Ctx[k, v]) LInsertAfter ¶
func (*Ctx[k, v]) LInsertBefore ¶
func (*Ctx[k, v]) Set ¶
for the reason of protection, both db.Key & Key are required. the avoid set Hash table to the wrong type , and thus leading to data loss.
func (*Ctx[k, v]) UnmarshalRedisZ ¶
func (*Ctx[k, v]) UnmarshalToSlice ¶
func (*Ctx[k, v]) UpgradeSchema ¶
func (*Ctx[k, v]) ZRangeByScore ¶
func (*Ctx[k, v]) ZRangeByScoreWithScores ¶
func (*Ctx[k, v]) ZRangeWithScores ¶
func (*Ctx[k, v]) ZRemRangeByRank ¶
func (*Ctx[k, v]) ZRemRangeByScore ¶
func (*Ctx[k, v]) ZRevRangeByScore ¶
func (*Ctx[k, v]) ZRevRangeByScoreWithScores ¶
func (*Ctx[k, v]) ZRevRangeWithScores ¶
type DataOption ¶
DataOption is parameter to create an API, RPC, or CallAt
var Option *DataOption
func (*DataOption) WithDataSource ¶
func (o *DataOption) WithDataSource(dataSource string) (out *DataOption)
func (*DataOption) WithKey ¶
func (o *DataOption) WithKey(key string) (out *DataOption)
WithKey purpose of ApiNamed is to allow different API to have the same input type
Click to show internal directories.
Click to hide internal directories.