Documentation ¶
Index ¶
Constants ¶
View Source
const (
NotifyPrefix = "configleam:notify"
)
Variables ¶
View Source
var PubSubChannel = "channel"
Functions ¶
This section is empty.
Types ¶
type EtcdRepository ¶
func NewEtcdRepository ¶
func NewEtcdRepository(etcd *etcd.Etcd) *EtcdRepository
func (*EtcdRepository) Publish ¶
func (r *EtcdRepository) Publish(ctx context.Context, payload string) error
Publish updates the value of a key, triggering notifications to watchers.
func (*EtcdRepository) Subscribe ¶
func (r *EtcdRepository) Subscribe(ctx context.Context, callback func(payload string))
Subscribe watches changes on a specific key or prefix.
func (*EtcdRepository) Unsubscribe ¶
func (r *EtcdRepository) Unsubscribe()
Unsubscribe might be more complex in an etcd context; it may involve canceling the context passed to the watch.
type PublishUpdateError ¶
type PublishUpdateError struct{}
func (PublishUpdateError) Error ¶
func (e PublishUpdateError) Error() string
type RedisRepository ¶
func NewRedisRepository ¶
func NewRedisRepository(redis *rds.Redis) *RedisRepository
func (*RedisRepository) Publish ¶
func (r *RedisRepository) Publish(ctx context.Context, payload string) error
func (*RedisRepository) Subscribe ¶
func (r *RedisRepository) Subscribe(ctx context.Context, callback func(payload string))
func (*RedisRepository) Unsubscribe ¶
func (r *RedisRepository) Unsubscribe()
Click to show internal directories.
Click to hide internal directories.