Documentation
¶
Overview ¶
Caddy module wrapper that registers the Redis transport as http.handlers.mercure.redis. Enables `transport redis { url ...; stream ...; size ... }` in Caddyfile.
Index ¶
- type Redis
- type RedisTransport
- func (t *RedisTransport) AddSubscriber(ctx context.Context, subscriber *mercure.LocalSubscriber) error
- func (t *RedisTransport) Close(_ context.Context) (err error)
- func (t *RedisTransport) Dispatch(ctx context.Context, update *mercure.Update) error
- func (t *RedisTransport) GetSubscribers(_ context.Context) (string, []*mercure.Subscriber, error)
- func (t *RedisTransport) RemoveSubscriber(_ context.Context, subscriber *mercure.LocalSubscriber) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct {
URL string `json:"url,omitempty"`
Stream string `json:"stream,omitempty"`
Size int64 `json:"size,omitempty"`
HistoryLimit *int64 `json:"history_limit,omitempty"` // nil = default, 0 = replay disabled
// contains filtered or unexported fields
}
func (Redis) CaddyModule ¶
func (Redis) CaddyModule() caddy.ModuleInfo
func (*Redis) GetTransport ¶
type RedisTransport ¶
type RedisTransport struct {
// contains filtered or unexported fields
}
func NewRedisTransport ¶
func NewRedisTransport( subscriberList *mercure.SubscriberList, logger *slog.Logger, url string, stream string, size int64, historyLimit int64, ) (*RedisTransport, error)
func (*RedisTransport) AddSubscriber ¶
func (t *RedisTransport) AddSubscriber(ctx context.Context, subscriber *mercure.LocalSubscriber) error
func (*RedisTransport) GetSubscribers ¶
func (t *RedisTransport) GetSubscribers(_ context.Context) (string, []*mercure.Subscriber, error)
func (*RedisTransport) RemoveSubscriber ¶
func (t *RedisTransport) RemoveSubscriber(_ context.Context, subscriber *mercure.LocalSubscriber) error
Click to show internal directories.
Click to hide internal directories.