Documentation
¶
Index ¶
- Variables
- func PatchStructPath(target any, path string, value any) error
- type GroupedLocalStore
- func (s *GroupedLocalStore[G, K, V]) Delete(_ context.Context, key K) error
- func (s *GroupedLocalStore[G, K, V]) DeleteGroup(_ context.Context, groupKey G) error
- func (s *GroupedLocalStore[G, K, V]) Get(_ context.Context, key K) (V, bool, error)
- func (s *GroupedLocalStore[G, K, V]) Set(_ context.Context, value V) error
- type KeyFunc
- type LayeredStore
- type LocalStore
- type LocalStoreOption
- type RedisHashKey
- type RedisHashKeyFunc
- type RedisJSONHashStore
- type RedisJSONStore
- type RedisKeyFunc
- type RedisRawJSONStore
- type RedisRawSortedSetStore
- type RedisRefHMapStore
- func (s *RedisRefHMapStore[K, V]) Delete(ctx context.Context, key K) error
- func (s *RedisRefHMapStore[K, V]) Get(ctx context.Context, key K) (V, bool, error)
- func (s *RedisRefHMapStore[K, V]) Patch(ctx context.Context, key K, path string, value any) error
- func (s *RedisRefHMapStore[K, V]) Set(ctx context.Context, value V) error
- type RefHMapConfig
- type RefHMapKeyStringFunc
- type RefHMapPatcher
- type ReplicaConfig
- type ReplicaSyncer
- type StaleFunc
- type Store
- type StoreConfig
- type ValidateKeyFunc
- type ValidateValueFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRefHMapCycle = errors.New("cache: redis ref hmap cycle") ErrRefHMapMaxDepth = errors.New("cache: redis ref hmap max depth exceeded") ErrRefHMapUnsupported = errors.New("cache: redis ref hmap unsupported field") )
View Source
var ( ErrKeyFuncNil = errors.New("cache: key func is nil") ErrInvalidKey = errors.New("cache: invalid key") )
Functions ¶
Types ¶
type GroupedLocalStore ¶ added in v1.0.1
type GroupedLocalStore[G comparable, K comparable, V any] struct { // contains filtered or unexported fields }
func NewGroupedLocalStore ¶ added in v1.0.1
func NewGroupedLocalStore[G comparable, K comparable, V any](groupOf func(K) G, cfg StoreConfig[K, V]) *GroupedLocalStore[G, K, V]
func (*GroupedLocalStore[G, K, V]) Delete ¶ added in v1.0.1
func (s *GroupedLocalStore[G, K, V]) Delete(_ context.Context, key K) error
func (*GroupedLocalStore[G, K, V]) DeleteGroup ¶ added in v1.0.1
func (s *GroupedLocalStore[G, K, V]) DeleteGroup(_ context.Context, groupKey G) error
type KeyFunc ¶ added in v1.0.1
type KeyFunc[K comparable, V any] func(V) K
type LayeredStore ¶ added in v1.0.1
type LayeredStore[K comparable, V any] struct { // contains filtered or unexported fields }
func NewLayeredStore ¶ added in v1.0.1
func NewLayeredStore[K comparable, V any](local Store[K, V], remote Store[K, V], ttl time.Duration, cfg StoreConfig[K, V]) *LayeredStore[K, V]
func (*LayeredStore[K, V]) Delete ¶ added in v1.0.1
func (s *LayeredStore[K, V]) Delete(ctx context.Context, key K) error
type LocalStore ¶ added in v1.0.1
type LocalStore[K comparable, V any] struct { // contains filtered or unexported fields }
func NewLocalStore ¶ added in v1.0.1
func NewLocalStore[K comparable, V any](cfg StoreConfig[K, V], opts ...LocalStoreOption[K, V]) *LocalStore[K, V]
func (*LocalStore[K, V]) Delete ¶ added in v1.0.1
func (s *LocalStore[K, V]) Delete(_ context.Context, key K) error
type LocalStoreOption ¶ added in v1.0.1
type LocalStoreOption[K comparable, V any] func(*LocalStore[K, V])
func WithLocalMaxEntries ¶ added in v1.0.1
func WithLocalMaxEntries[K comparable, V any](maxEntries int) LocalStoreOption[K, V]
type RedisHashKey ¶
type RedisHashKeyFunc ¶
type RedisHashKeyFunc[K comparable] func(K) RedisHashKey
type RedisJSONHashStore ¶
type RedisJSONHashStore[K comparable, V any] struct { // contains filtered or unexported fields }
func NewRedisJSONHashStore ¶
func NewRedisJSONHashStore[K comparable, V any](redis fredis.IRedis, ttl time.Duration, key RedisHashKeyFunc[K], cfg StoreConfig[K, V]) *RedisJSONHashStore[K, V]
func (*RedisJSONHashStore[K, V]) Delete ¶
func (s *RedisJSONHashStore[K, V]) Delete(ctx context.Context, key K) error
type RedisJSONStore ¶
type RedisJSONStore[K comparable, V any] struct { // contains filtered or unexported fields }
func NewRedisJSONStore ¶
func NewRedisJSONStore[K comparable, V any](redis fredis.IRedis, ttl time.Duration, key RedisKeyFunc[K], cfg StoreConfig[K, V]) *RedisJSONStore[K, V]
func (*RedisJSONStore[K, V]) Delete ¶
func (s *RedisJSONStore[K, V]) Delete(ctx context.Context, key K) error
type RedisKeyFunc ¶
type RedisKeyFunc[K comparable] func(K) string
type RedisRawJSONStore ¶
type RedisRawJSONStore[K comparable, V any] struct { // contains filtered or unexported fields }
func NewRedisRawJSONStore ¶
func NewRedisRawJSONStore[K comparable, V any](redis fredis.IRedis, ttl time.Duration, key RedisKeyFunc[K], cfg StoreConfig[K, V]) *RedisRawJSONStore[K, V]
func (*RedisRawJSONStore[K, V]) Delete ¶
func (s *RedisRawJSONStore[K, V]) Delete(ctx context.Context, key K) error
type RedisRawSortedSetStore ¶
type RedisRawSortedSetStore[M ~int64 | ~int | ~string] struct { // contains filtered or unexported fields }
func (*RedisRawSortedSetStore[M]) Delete ¶
func (s *RedisRawSortedSetStore[M]) Delete(ctx context.Context, member M) error
type RedisRefHMapStore ¶
type RedisRefHMapStore[K comparable, V any] struct { // contains filtered or unexported fields }
func NewRedisRefHMapStore ¶
func NewRedisRefHMapStore[K comparable, V any](redis fredis.IRedis, cfg RefHMapConfig[K, V]) *RedisRefHMapStore[K, V]
func (*RedisRefHMapStore[K, V]) Delete ¶
func (s *RedisRefHMapStore[K, V]) Delete(ctx context.Context, key K) error
func (*RedisRefHMapStore[K, V]) Get ¶
func (s *RedisRefHMapStore[K, V]) Get(ctx context.Context, key K) (V, bool, error)
type RefHMapConfig ¶
type RefHMapConfig[K comparable, V any] struct { Prefix string Name string TTL time.Duration MaxDepth int KeyString RefHMapKeyStringFunc[K] StoreConfig StoreConfig[K, V] }
type RefHMapKeyStringFunc ¶
type RefHMapKeyStringFunc[K comparable] func(K) string
type RefHMapPatcher ¶
type ReplicaConfig ¶
type ReplicaSyncer ¶
type ReplicaSyncer[K comparable, V any] struct { // contains filtered or unexported fields }
func NewReplicaSyncer ¶
func NewReplicaSyncer[K comparable, V any](bus fsync.ISyncBus, cfg ReplicaConfig[K, V]) *ReplicaSyncer[K, V]
func (*ReplicaSyncer[K, V]) Publish ¶
func (s *ReplicaSyncer[K, V]) Publish(ctx context.Context, value V) error
func (*ReplicaSyncer[K, V]) PublishDelete ¶
func (*ReplicaSyncer[K, V]) Start ¶
func (s *ReplicaSyncer[K, V]) Start() error
func (*ReplicaSyncer[K, V]) Stop ¶
func (s *ReplicaSyncer[K, V]) Stop()
type StaleFunc ¶ added in v1.0.1
func VersionStale ¶ added in v1.0.1
type StoreConfig ¶ added in v1.0.1
type StoreConfig[K comparable, V any] struct { KeyOf KeyFunc[K, V] Stale StaleFunc[V] ValidateKey ValidateKeyFunc[K] ValidateValue ValidateValueFunc[V] }
type ValidateKeyFunc ¶ added in v1.0.1
type ValidateKeyFunc[K comparable] func(K) bool
type ValidateValueFunc ¶ added in v1.0.1
Click to show internal directories.
Click to hide internal directories.