Documentation ¶
Index ¶
- func InMemProvider(ctx context.Context, config *viper.Viper) (providers.Cache, error)
- func InMemStreamProvider(ctx context.Context, config *viper.Viper) (providers.Stream, error)
- func Provider(ctx context.Context, config *viper.Viper) (providers.Cache, error)
- func StreamProvider(ctx context.Context, config *viper.Viper) (providers.Stream, error)
- type Redis
- func (r Redis) AsyncSubscribe(ctx context.Context, topic, consumer string, handler providers.MessageHandler) error
- func (r Redis) Delete(ctx context.Context, key string) error
- func (r Redis) Get(ctx context.Context, key string) (string, error)
- func (r Redis) Lock(ctx context.Context, key string, ttl time.Duration) (bool, error)
- func (r Redis) Once(ctx context.Context, key string, ttl time.Duration, ...) (bool, error)
- func (r Redis) Publish(ctx context.Context, topic string, message map[string]any) error
- func (r Redis) Set(ctx context.Context, key string, value string, ttl time.Duration) error
- func (r Redis) Subscribe(ctx context.Context, topic, consumer string, handler providers.MessageHandler) error
- func (r Redis) Unlock(ctx context.Context, key string, ttl time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InMemProvider ¶
InMemProvider returns a new in-memory redis provider(used for testing)
func InMemStreamProvider ¶
InMemProvider returns a new in-memory redis stream provider(used for testing)
Types ¶
Click to show internal directories.
Click to hide internal directories.