Documentation
¶
Index ¶
- type CacheKey
- type CacheKeyOptions
- type ConfigRedisRepo
- func (c *ConfigRedisRepo[T, V]) GetConfig(ctx context.Context, key string, entityId T) (*V, error)
- func (c *ConfigRedisRepo[T, V]) GetConfigByKeyForEntity(ctx context.Context, key string) (*V, error)
- func (c *ConfigRedisRepo[T, V]) IsConfigCacheKeyPresent(ctx context.Context, key string) (bool, error)
- func (c *ConfigRedisRepo[T, V]) SaveConfig(ctx context.Context, key string, config *V) error
- type IConfigCacheRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheKey ¶
func NewCacheKey ¶
func NewCacheKey[T config.TenantId, V any](entityId T, opts ...CacheKeyOptions[T, V]) *CacheKey[T, V]
func (*CacheKey[T, V]) DefaultValue ¶
type CacheKeyOptions ¶
func WithCacheConfigKey ¶
func WithCacheConfigKey[T config.TenantId, V any](configKey string) CacheKeyOptions[T, V]
func WithCacheKeyPrefix ¶
func WithCacheKeyPrefix[T config.TenantId, V any](prefix string) CacheKeyOptions[T, V]
type ConfigRedisRepo ¶
type ConfigRedisRepo[T config.TenantId, V any] struct { RNonClusteredClient *redis.Client ConfigDbRepo configDb.IConfigDbRepo[T, V] TTL time.Duration }
func RegisterConfigForCacheOps ¶
func RegisterConfigForCacheOps[T config.TenantId, V any](client *redis.Client, configDbRepo configDb.IConfigDbRepo[T, V], ttl time.Duration) *ConfigRedisRepo[T, V]
func (*ConfigRedisRepo[T, V]) GetConfig ¶
func (c *ConfigRedisRepo[T, V]) GetConfig(ctx context.Context, key string, entityId T) (*V, error)
func (*ConfigRedisRepo[T, V]) GetConfigByKeyForEntity ¶
func (c *ConfigRedisRepo[T, V]) GetConfigByKeyForEntity(ctx context.Context, key string) (*V, error)
func (*ConfigRedisRepo[T, V]) IsConfigCacheKeyPresent ¶
func (*ConfigRedisRepo[T, V]) SaveConfig ¶
func (c *ConfigRedisRepo[T, V]) SaveConfig(ctx context.Context, key string, config *V) error
type IConfigCacheRepo ¶
type IConfigCacheRepo[T config.TenantId, V any] interface { SaveConfig(ctx context.Context, key string, config *V) error GetConfigByKeyForEntity(ctx context.Context, key string) (*V, error) GetConfig(ctx context.Context, key string, entityId T) (*V, error) IsConfigCacheKeyPresent(ctx context.Context, key string) (bool, error) }
Click to show internal directories.
Click to hide internal directories.