Documentation ¶
Index ¶
- Variables
- func DisableDebugLogging()
- func EnableDebugLogging()
- func SetConfiguration(name, namespace, url string, opts ...RedisOption) error
- func SetDebugLogger(userLogger logging)
- type Counter
- type Cycle
- type Enum
- type Flag
- type FlagMarkOption
- type FlagMarkOptions
- type Hash
- func NewBoolHash(key string, opts ...ProxyOption) (*Hash[bool], error)
- func NewBoolHashWithDefault(key string, defaultElements map[string]bool, opts ...ProxyOption) (h *Hash[bool], err error)
- func NewFloatHash(key string, opts ...ProxyOption) (*Hash[float64], error)
- func NewFloatHashWithDefault(key string, defaultElements map[string]float64, opts ...ProxyOption) (h *Hash[float64], err error)
- func NewIntegerHash(key string, opts ...ProxyOption) (*Hash[int], error)
- func NewIntegerHashWithDefault(key string, defaultElements map[string]int, opts ...ProxyOption) (h *Hash[int], err error)
- func NewJSONHash(key string, opts ...ProxyOption) (*Hash[KredisJSON], error)
- func NewJSONHashWithDefault(key string, defaultElements map[string]KredisJSON, opts ...ProxyOption) (h *Hash[KredisJSON], err error)
- func NewStringHash(key string, opts ...ProxyOption) (*Hash[string], error)
- func NewStringHashWithDefault(key string, defaultElements map[string]string, opts ...ProxyOption) (h *Hash[string], err error)
- func NewTimeHash(key string, opts ...ProxyOption) (*Hash[time.Time], error)
- func NewTimeHashWithDefault(key string, defaultElements map[string]time.Time, opts ...ProxyOption) (h *Hash[time.Time], err error)
- func (h *Hash[T]) Clear() error
- func (h Hash[T]) Delete(fields ...string) (int64, error)
- func (h *Hash[T]) Entries() (entries map[string]T, err error)
- func (h *Hash[T]) Get(field string) (T, bool)
- func (h *Hash[T]) Keys() (keys []string, err error)
- func (h *Hash[T]) Set(field string, entry T) (err error)
- func (h *Hash[T]) Update(entries map[string]T) (int64, error)
- func (h *Hash[T]) Values() (values []T, err error)
- func (h *Hash[T]) ValuesAt(fields ...string) (values []T, err error)
- type KredisJSON
- type KredisTyped
- type Limiter
- type List
- func NewBoolList(key string, opts ...ProxyOption) (*List[bool], error)
- func NewBoolListWithDefault(key string, defaultElements []bool, opts ...ProxyOption) (l *List[bool], err error)
- func NewFloatList(key string, opts ...ProxyOption) (*List[float64], error)
- func NewFloatListWithDefault(key string, defaultElements []float64, opts ...ProxyOption) (l *List[float64], err error)
- func NewIntegerList(key string, opts ...ProxyOption) (*List[int], error)
- func NewIntegerListWithDefault(key string, defaultElements []int, opts ...ProxyOption) (l *List[int], err error)
- func NewJSONList(key string, opts ...ProxyOption) (*List[KredisJSON], error)
- func NewJSONListWithDefault(key string, defaultElements []KredisJSON, opts ...ProxyOption) (l *List[KredisJSON], err error)
- func NewStringList(key string, opts ...ProxyOption) (*List[string], error)
- func NewStringListWithDefault(key string, defaultElements []string, opts ...ProxyOption) (l *List[string], err error)
- func NewTimeList(key string, opts ...ProxyOption) (*List[time.Time], error)
- func NewTimeListWithDefault(key string, defaultElements []time.Time, opts ...ProxyOption) (l *List[time.Time], err error)
- func (l *List[T]) Append(elements ...T) (int64, error)
- func (l *List[T]) Clear() error
- func (l *List[T]) Elements(elements []T, opts ...RangeOption) (total int64, err error)
- func (l List[T]) Last() (T, bool)
- func (l List[T]) LastN(elements []T) (total int64, err error)
- func (l *List[T]) Length() (llen int64, err error)
- func (l List[T]) Prepend(elements ...T) (int64, error)
- func (l *List[T]) Remove(elements ...T) (err error)
- type OrderedSet
- func NewBoolOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[bool], error)
- func NewBoolOrderedSetWithDefault(key string, limit uint64, defaultMembers []bool, opts ...ProxyOption) (s *OrderedSet[bool], err error)
- func NewFloatOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[float64], error)
- func NewFloatOrderedSetWithDefault(key string, limit uint64, defaultMembers []float64, opts ...ProxyOption) (s *OrderedSet[float64], err error)
- func NewIntegerOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[int], error)
- func NewIntegerOrderedSetWithDefault(key string, limit uint64, defaultMembers []int, opts ...ProxyOption) (s *OrderedSet[int], err error)
- func NewJSONOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[KredisJSON], error)
- func NewJSONOrderedSetWithDefault(key string, limit uint64, defaultMembers []KredisJSON, opts ...ProxyOption) (s *OrderedSet[KredisJSON], err error)
- func NewStringOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[string], error)
- func NewStringOrderedSetWithDefault(key string, limit uint64, defaultMembers []string, opts ...ProxyOption) (s *OrderedSet[string], err error)
- func NewTimeOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[time.Time], error)
- func NewTimeOrderedSetWithDefault(key string, limit uint64, defaultMembers []time.Time, opts ...ProxyOption) (s *OrderedSet[time.Time], err error)
- func (s *OrderedSet[T]) Append(members ...T) (added int64, removed int64, err error)
- func (s *OrderedSet[T]) Clear() error
- func (s *OrderedSet[T]) Includes(member T) bool
- func (s *OrderedSet[T]) Members() ([]T, error)
- func (s *OrderedSet[T]) Prepend(members ...T) (added int64, removed int64, err error)
- func (s *OrderedSet[T]) Remove(members ...T) (removed int64, err error)
- func (s *OrderedSet[T]) SetLimit(limit uint64)
- func (s *OrderedSet[T]) Size() int64
- type Proxy
- type ProxyOption
- type ProxyOptions
- type RangeOption
- type RangeOptions
- type RedisOption
- type ScalarBool
- type ScalarFloat
- type ScalarInteger
- type ScalarJSON
- type ScalarString
- type ScalarTime
- type Set
- func NewBoolSet(key string, opts ...ProxyOption) (*Set[bool], error)
- func NewBoolSetWithDefault(key string, defaultMembers []bool, opts ...ProxyOption) (s *Set[bool], err error)
- func NewFloatSet(key string, opts ...ProxyOption) (*Set[float64], error)
- func NewFloatSetWithDefault(key string, defaultMembers []float64, opts ...ProxyOption) (s *Set[float64], err error)
- func NewIntegerSet(key string, opts ...ProxyOption) (*Set[int], error)
- func NewIntegerSetWithDefault(key string, defaultMembers []int, opts ...ProxyOption) (s *Set[int], err error)
- func NewJSONSet(key string, opts ...ProxyOption) (*Set[KredisJSON], error)
- func NewJSONSetWithDefault(key string, defaultMembers []KredisJSON, opts ...ProxyOption) (s *Set[KredisJSON], err error)
- func NewStringSet(key string, opts ...ProxyOption) (*Set[string], error)
- func NewStringSetWithDefault(key string, defaultMembers []string, opts ...ProxyOption) (s *Set[string], err error)
- func NewTimeSet(key string, opts ...ProxyOption) (*Set[time.Time], error)
- func NewTimeSetWithDefault(key string, defaultMembers []time.Time, opts ...ProxyOption) (s *Set[time.Time], err error)
- func (s *Set[T]) Add(members ...T) (added int64, err error)
- func (s *Set[T]) Clear() error
- func (s *Set[T]) Includes(member T) bool
- func (s *Set[T]) Members() ([]T, error)
- func (s *Set[T]) MembersMap() (map[T]struct{}, error)
- func (s *Set[T]) Remove(members ...T) (removed int64, err error)
- func (s *Set[T]) Replace(members ...T) (int64, error)
- func (s *Set[T]) Sample(members []T) (total int64, err error)
- func (s *Set[T]) Size() int64
- func (s *Set[T]) Take() (T, bool)
- func (s *Set[T]) TakeN(members []T) (total int64, err error)
- type Slot
- type SlotCallback
- type UniqueList
- func NewBoolUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[bool], error)
- func NewBoolUniqueListWithDefault(key string, limit uint64, defaultElements []bool, opts ...ProxyOption) (l *UniqueList[bool], err error)
- func NewFloatUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[float64], error)
- func NewFloatUniqueListWithDefault(key string, limit uint64, defaultElements []float64, opts ...ProxyOption) (l *UniqueList[float64], err error)
- func NewIntegerUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[int], error)
- func NewIntegerUniqueListWithDefault(key string, limit uint64, defaultElements []int, opts ...ProxyOption) (l *UniqueList[int], err error)
- func NewJSONUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[KredisJSON], error)
- func NewJSONUniqueListWithDefault(key string, limit uint64, defaultElements []KredisJSON, opts ...ProxyOption) (l *UniqueList[KredisJSON], err error)
- func NewStringUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[string], error)
- func NewStringUniqueListWithDefault(key string, limit uint64, defaultElements []string, opts ...ProxyOption) (l *UniqueList[string], err error)
- func NewTimeUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[time.Time], error)
- func NewTimeUniqueListWithDefault(key string, limit uint64, defaultElements []time.Time, opts ...ProxyOption) (l *UniqueList[time.Time], err error)
- func (l *UniqueList[T]) Append(elements ...T) (int64, error)
- func (l *UniqueList[T]) Clear() error
- func (l *UniqueList[T]) Elements(elements []T, opts ...RangeOption) (total int64, err error)
- func (l UniqueList[T]) Last() (T, bool)
- func (l UniqueList[T]) LastN(elements []T) (total int64, err error)
- func (l *UniqueList[T]) Length() (llen int64, err error)
- func (l UniqueList[T]) Prepend(elements ...T) (int64, error)
- func (l *UniqueList[T]) Remove(elements ...T) (err error)
- func (l *UniqueList[T]) SetLimit(limit uint64)
Constants ¶
This section is empty.
Variables ¶
var EnumEmptyValues = errors.New("values cannot be empty")
var EnumExpiryNotSupported = errors.New("cannot use WithExpiry with Enum")
var EnumInvalidValue = errors.New("invalid enum value")
Functions ¶
func EnableDebugLogging ¶
func EnableDebugLogging()
Enable logging of Redis commands and errors that are ignored by functions with failsafes. This is useful for development and tests. Logging is disabled by default.
func SetConfiguration ¶
func SetConfiguration(name, namespace, url string, opts ...RedisOption) error
func SetDebugLogger ¶
func SetDebugLogger(userLogger logging)
Types ¶
type Counter ¶
type Counter struct {
Proxy
}
func NewCounter ¶
func NewCounter(key string, opts ...ProxyOption) (*Counter, error)
func NewCounterWithDefault ¶
func NewCounterWithDefault(key string, defaultValue int64, opts ...ProxyOption) (c *Counter, err error)
func (*Counter) ValueResult ¶
type Cycle ¶
type Cycle struct { Proxy // contains filtered or unexported fields }
func (*Cycle) IndexResult ¶
type Flag ¶
type Flag struct {
Proxy
}
func NewMarkedFlag ¶
func NewMarkedFlag(key string, opts ...ProxyOption) (*Flag, error)
func (*Flag) Mark ¶
func (f *Flag) Mark(opts ...FlagMarkOption) error
func (*Flag) SoftMark ¶
func (f *Flag) SoftMark(opts ...FlagMarkOption) error
type FlagMarkOption ¶
type FlagMarkOption func(*FlagMarkOptions)
func WithFlagExpiry ¶
func WithFlagExpiry(expires string) FlagMarkOption
type FlagMarkOptions ¶
type FlagMarkOptions struct {
// contains filtered or unexported fields
}
type Hash ¶
type Hash[T KredisTyped] struct { Proxy // contains filtered or unexported fields }
func NewBoolHash ¶
func NewBoolHash(key string, opts ...ProxyOption) (*Hash[bool], error)
func NewBoolHashWithDefault ¶
func NewFloatHash ¶
func NewFloatHash(key string, opts ...ProxyOption) (*Hash[float64], error)
func NewFloatHashWithDefault ¶
func NewIntegerHash ¶
func NewIntegerHash(key string, opts ...ProxyOption) (*Hash[int], error)
func NewJSONHash ¶
func NewJSONHash(key string, opts ...ProxyOption) (*Hash[KredisJSON], error)
func NewJSONHashWithDefault ¶
func NewJSONHashWithDefault(key string, defaultElements map[string]KredisJSON, opts ...ProxyOption) (h *Hash[KredisJSON], err error)
func NewStringHash ¶
func NewStringHash(key string, opts ...ProxyOption) (*Hash[string], error)
func NewTimeHash ¶
func NewTimeHashWithDefault ¶
type KredisJSON ¶
type KredisJSON struct {
// contains filtered or unexported fields
}
func NewKredisJSON ¶
func NewKredisJSON(jsonStr string) *KredisJSON
KredisJSON is a small struct wrapper for dealing with JSON strings
func (KredisJSON) String ¶
func (kj KredisJSON) String() string
func (*KredisJSON) Unmarshal ¶
func (kj *KredisJSON) Unmarshal(data any) error
type KredisTyped ¶
type KredisTyped interface { comparable ~bool | ~int | ~float64 | ~string | KredisJSON | time.Time }
type Limiter ¶
type Limiter struct { Proxy // contains filtered or unexported fields }
From the Kredis code docs:
A limiter is a specialized form of a counter that can be checked whether it has been exceeded and is provided fail safe. This means it can be used to guard login screens from brute force attacks without denying access in case Redis is offline.
func NewLimiter ¶
func NewLimiter(key string, limit uint64, opts ...ProxyOption) (*Limiter, error)
func NewLimiterWithDefault ¶
func NewLimiterWithDefault(key string, limit uint64, defaultValue int64, opts ...ProxyOption) (l *Limiter, err error)
Similarly to the Poke func, the error be ignored, depending on the use case
func (*Limiter) IsExceeded ¶
It's possible for this func to return false even if we're above the limit due to a potential race condition.
type List ¶
type List[T KredisTyped] struct { Proxy // contains filtered or unexported fields }
func NewBoolList ¶
func NewBoolList(key string, opts ...ProxyOption) (*List[bool], error)
func NewBoolListWithDefault ¶
func NewFloatList ¶
func NewFloatList(key string, opts ...ProxyOption) (*List[float64], error)
func NewFloatListWithDefault ¶
func NewIntegerList ¶
func NewIntegerList(key string, opts ...ProxyOption) (*List[int], error)
func NewJSONList ¶
func NewJSONList(key string, opts ...ProxyOption) (*List[KredisJSON], error)
func NewJSONListWithDefault ¶
func NewJSONListWithDefault(key string, defaultElements []KredisJSON, opts ...ProxyOption) (l *List[KredisJSON], err error)
func NewStringList ¶
func NewStringList(key string, opts ...ProxyOption) (*List[string], error)
func NewTimeList ¶
func NewTimeListWithDefault ¶
type OrderedSet ¶
type OrderedSet[T KredisTyped] struct { Proxy // contains filtered or unexported fields }
Backed by Sorted Sets in redis
func NewBoolOrderedSet ¶
func NewBoolOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[bool], error)
func NewBoolOrderedSetWithDefault ¶
func NewBoolOrderedSetWithDefault(key string, limit uint64, defaultMembers []bool, opts ...ProxyOption) (s *OrderedSet[bool], err error)
func NewFloatOrderedSet ¶
func NewFloatOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[float64], error)
func NewFloatOrderedSetWithDefault ¶
func NewFloatOrderedSetWithDefault(key string, limit uint64, defaultMembers []float64, opts ...ProxyOption) (s *OrderedSet[float64], err error)
func NewIntegerOrderedSet ¶
func NewIntegerOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[int], error)
func NewIntegerOrderedSetWithDefault ¶
func NewIntegerOrderedSetWithDefault(key string, limit uint64, defaultMembers []int, opts ...ProxyOption) (s *OrderedSet[int], err error)
func NewJSONOrderedSet ¶
func NewJSONOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[KredisJSON], error)
func NewJSONOrderedSetWithDefault ¶
func NewJSONOrderedSetWithDefault(key string, limit uint64, defaultMembers []KredisJSON, opts ...ProxyOption) (s *OrderedSet[KredisJSON], err error)
func NewStringOrderedSet ¶
func NewStringOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[string], error)
func NewStringOrderedSetWithDefault ¶
func NewStringOrderedSetWithDefault(key string, limit uint64, defaultMembers []string, opts ...ProxyOption) (s *OrderedSet[string], err error)
func NewTimeOrderedSet ¶
func NewTimeOrderedSet(key string, limit uint64, opts ...ProxyOption) (*OrderedSet[time.Time], error)
func NewTimeOrderedSetWithDefault ¶
func NewTimeOrderedSetWithDefault(key string, limit uint64, defaultMembers []time.Time, opts ...ProxyOption) (s *OrderedSet[time.Time], err error)
func (*OrderedSet[T]) Append ¶
func (s *OrderedSet[T]) Append(members ...T) (added int64, removed int64, err error)
func (*OrderedSet[T]) Clear ¶
func (s *OrderedSet[T]) Clear() error
func (*OrderedSet[T]) Includes ¶
func (s *OrderedSet[T]) Includes(member T) bool
func (*OrderedSet[T]) Members ¶
func (s *OrderedSet[T]) Members() ([]T, error)
func (*OrderedSet[T]) Prepend ¶
func (s *OrderedSet[T]) Prepend(members ...T) (added int64, removed int64, err error)
func (*OrderedSet[T]) Remove ¶
func (s *OrderedSet[T]) Remove(members ...T) (removed int64, err error)
func (*OrderedSet[T]) SetLimit ¶
func (s *OrderedSet[T]) SetLimit(limit uint64)
func (*OrderedSet[T]) Size ¶
func (s *OrderedSet[T]) Size() int64
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func (*Proxy) RefreshTTL ¶
Set the key's EXPIRE using the configured expiresIn. If there is no value configured, nothing happens.
type ProxyOption ¶
type ProxyOption func(*ProxyOptions)
func WithConfigName ¶
func WithConfigName(name string) ProxyOption
func WithContext ¶
func WithContext(ctx context.Context) ProxyOption
func WithExpiry ¶
func WithExpiry(expires string) ProxyOption
type ProxyOptions ¶
type ProxyOptions struct {
// contains filtered or unexported fields
}
func (*ProxyOptions) Config ¶
func (o *ProxyOptions) Config() string
func (*ProxyOptions) ExpiresIn ¶
func (o *ProxyOptions) ExpiresIn() time.Duration
type RangeOption ¶
type RangeOption func(*RangeOptions)
func WithRangeStart ¶
func WithRangeStart(s int64) RangeOption
type RangeOptions ¶
type RangeOptions struct {
// contains filtered or unexported fields
}
type RedisOption ¶
type RedisOption func(*redis.Options)
type ScalarBool ¶
type ScalarBool struct{ Proxy }
func NewBool ¶
func NewBool(key string, opts ...ProxyOption) (*ScalarBool, error)
func NewBoolWithDefault ¶
func NewBoolWithDefault(key string, defaultValue bool, opts ...ProxyOption) (s *ScalarBool, err error)
func (*ScalarBool) SetValue ¶
func (s *ScalarBool) SetValue(v bool) error
func (*ScalarBool) Value ¶
func (s *ScalarBool) Value() bool
func (*ScalarBool) ValueResult ¶
func (s *ScalarBool) ValueResult() (*bool, error)
type ScalarFloat ¶
type ScalarFloat struct{ Proxy }
func NewFloat ¶
func NewFloat(key string, opts ...ProxyOption) (*ScalarFloat, error)
func NewFloatWithDefault ¶
func NewFloatWithDefault(key string, defaultValue float64, opts ...ProxyOption) (s *ScalarFloat, err error)
func (*ScalarFloat) SetValue ¶
func (s *ScalarFloat) SetValue(v float64) error
func (*ScalarFloat) Value ¶
func (s *ScalarFloat) Value() float64
func (*ScalarFloat) ValueResult ¶
func (s *ScalarFloat) ValueResult() (*float64, error)
type ScalarInteger ¶
type ScalarInteger struct{ Proxy }
func NewInteger ¶
func NewInteger(key string, opts ...ProxyOption) (*ScalarInteger, error)
func NewIntegerWithDefault ¶
func NewIntegerWithDefault(key string, defaultValue int, opts ...ProxyOption) (s *ScalarInteger, err error)
func (*ScalarInteger) SetValue ¶
func (s *ScalarInteger) SetValue(v int) error
func (*ScalarInteger) Value ¶
func (s *ScalarInteger) Value() int
func (*ScalarInteger) ValueResult ¶
func (s *ScalarInteger) ValueResult() (*int, error)
type ScalarJSON ¶
type ScalarJSON struct{ Proxy }
func NewJSON ¶
func NewJSON(key string, opts ...ProxyOption) (*ScalarJSON, error)
func NewJSONWithDefault ¶
func NewJSONWithDefault(key string, defaultValue *KredisJSON, opts ...ProxyOption) (s *ScalarJSON, err error)
func (*ScalarJSON) SetValue ¶
func (s *ScalarJSON) SetValue(v *KredisJSON) error
func (*ScalarJSON) Value ¶
func (s *ScalarJSON) Value() KredisJSON
func (*ScalarJSON) ValueResult ¶
func (s *ScalarJSON) ValueResult() (*KredisJSON, error)
type ScalarString ¶
type ScalarString struct{ Proxy }
func NewString ¶
func NewString(key string, opts ...ProxyOption) (*ScalarString, error)
func NewStringWithDefault ¶
func NewStringWithDefault(key string, defaultValue string, opts ...ProxyOption) (s *ScalarString, err error)
func (*ScalarString) SetValue ¶
func (s *ScalarString) SetValue(v string) error
func (*ScalarString) Value ¶
func (s *ScalarString) Value() string
func (*ScalarString) ValueResult ¶
func (s *ScalarString) ValueResult() (*string, error)
type ScalarTime ¶
type ScalarTime struct{ Proxy }
func NewTime ¶
func NewTime(key string, opts ...ProxyOption) (*ScalarTime, error)
func NewTimeWithDefault ¶
func NewTimeWithDefault(key string, defaultValue time.Time, opts ...ProxyOption) (s *ScalarTime, err error)
func (*ScalarTime) Value ¶
func (s *ScalarTime) Value() time.Time
func (*ScalarTime) ValueResult ¶
func (s *ScalarTime) ValueResult() (*time.Time, error)
type Set ¶
type Set[T KredisTyped] struct { Proxy // contains filtered or unexported fields }
func NewBoolSet ¶
func NewBoolSet(key string, opts ...ProxyOption) (*Set[bool], error)
func NewBoolSetWithDefault ¶
func NewFloatSet ¶
func NewFloatSet(key string, opts ...ProxyOption) (*Set[float64], error)
func NewFloatSetWithDefault ¶
func NewIntegerSet ¶
func NewIntegerSet(key string, opts ...ProxyOption) (*Set[int], error)
func NewJSONSet ¶
func NewJSONSet(key string, opts ...ProxyOption) (*Set[KredisJSON], error)
func NewJSONSetWithDefault ¶
func NewJSONSetWithDefault(key string, defaultMembers []KredisJSON, opts ...ProxyOption) (s *Set[KredisJSON], err error)
func NewStringSet ¶
func NewStringSet(key string, opts ...ProxyOption) (*Set[string], error)
func NewStringSetWithDefault ¶
func NewTimeSet ¶
func NewTimeSetWithDefault ¶
func (*Set[T]) MembersMap ¶
type Slot ¶
type Slot struct { Proxy // contains filtered or unexported fields }
func (*Slot) IsAvailable ¶
func (*Slot) Reserve ¶
func (s *Slot) Reserve(callbacks ...SlotCallback) (reserved bool)
func (*Slot) TakenResult ¶
type SlotCallback ¶
type SlotCallback func()
type UniqueList ¶
type UniqueList[T KredisTyped] struct { Proxy // contains filtered or unexported fields }
func NewBoolUniqueList ¶
func NewBoolUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[bool], error)
func NewBoolUniqueListWithDefault ¶
func NewBoolUniqueListWithDefault(key string, limit uint64, defaultElements []bool, opts ...ProxyOption) (l *UniqueList[bool], err error)
func NewFloatUniqueList ¶
func NewFloatUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[float64], error)
func NewFloatUniqueListWithDefault ¶
func NewFloatUniqueListWithDefault(key string, limit uint64, defaultElements []float64, opts ...ProxyOption) (l *UniqueList[float64], err error)
func NewIntegerUniqueList ¶
func NewIntegerUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[int], error)
func NewIntegerUniqueListWithDefault ¶
func NewIntegerUniqueListWithDefault(key string, limit uint64, defaultElements []int, opts ...ProxyOption) (l *UniqueList[int], err error)
func NewJSONUniqueList ¶
func NewJSONUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[KredisJSON], error)
func NewJSONUniqueListWithDefault ¶
func NewJSONUniqueListWithDefault(key string, limit uint64, defaultElements []KredisJSON, opts ...ProxyOption) (l *UniqueList[KredisJSON], err error)
func NewStringUniqueList ¶
func NewStringUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[string], error)
func NewStringUniqueListWithDefault ¶
func NewStringUniqueListWithDefault(key string, limit uint64, defaultElements []string, opts ...ProxyOption) (l *UniqueList[string], err error)
func NewTimeUniqueList ¶
func NewTimeUniqueList(key string, limit uint64, opts ...ProxyOption) (*UniqueList[time.Time], error)
func NewTimeUniqueListWithDefault ¶
func NewTimeUniqueListWithDefault(key string, limit uint64, defaultElements []time.Time, opts ...ProxyOption) (l *UniqueList[time.Time], err error)
func (*UniqueList[T]) Append ¶
func (l *UniqueList[T]) Append(elements ...T) (int64, error)
func (*UniqueList[T]) Clear ¶
func (l *UniqueList[T]) Clear() error
func (*UniqueList[T]) Elements ¶
func (l *UniqueList[T]) Elements(elements []T, opts ...RangeOption) (total int64, err error)
NOTE we're using Do() for the "LRANGE" command instead of LRange() as to seemingly avoid an []string allocation from StringSliceCmd#Result()
func (UniqueList[T]) Last ¶
func (l UniqueList[T]) Last() (T, bool)
func (UniqueList[T]) LastN ¶
func (l UniqueList[T]) LastN(elements []T) (total int64, err error)
func (*UniqueList[T]) Length ¶
func (l *UniqueList[T]) Length() (llen int64, err error)
func (UniqueList[T]) Prepend ¶
func (l UniqueList[T]) Prepend(elements ...T) (int64, error)
func (*UniqueList[T]) Remove ¶
func (l *UniqueList[T]) Remove(elements ...T) (err error)
func (*UniqueList[T]) SetLimit ¶
func (l *UniqueList[T]) SetLimit(limit uint64)