asyncnotificationscfg

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderPusher is the Pusher provider.
	ProviderPusher = "pusher"
	// ProviderAbly is the Ably provider.
	ProviderAbly = "ably"
	// ProviderWebSocket is the WebSocket provider.
	ProviderWebSocket = "websocket"
	// ProviderSSE is the SSE provider.
	ProviderSSE = "sse"
	// ProviderNoop is the no-op provider.
	ProviderNoop = "noop"
)

Variables

This section is empty.

Functions

func ProvideAsyncNotifierFromConfig

func ProvideAsyncNotifierFromConfig(cfg *Config, logger logging.Logger, tracerProvider tracing.TracerProvider) (asyncnotifications.AsyncNotifier, error)

ProvideAsyncNotifierFromConfig provides an AsyncNotifier from a config.

func RegisterAsyncNotifier

func RegisterAsyncNotifier(i do.Injector)

RegisterAsyncNotifier registers an asyncnotifications.AsyncNotifier with the injector.

Types

type Config

type Config struct {
	Pusher    *pusher.Config   `env:"init"     envPrefix:"PUSHER_"    json:"pusher,omitempty"`
	Ably      *ably.Config     `env:"init"     envPrefix:"ABLY_"      json:"ably,omitempty"`
	WebSocket *asyncws.Config  `env:"init"     envPrefix:"WEBSOCKET_" json:"websocket,omitempty"`
	SSE       *asyncsse.Config `env:"init"     envPrefix:"SSE_"       json:"sse,omitempty"`
	Provider  string           `env:"PROVIDER" json:"provider"`
}

Config is the configuration for the async notifications provider.

func (*Config) ProvideAsyncNotifier

func (cfg *Config) ProvideAsyncNotifier(logger logging.Logger, tracerProvider tracing.TracerProvider) (asyncnotifications.AsyncNotifier, error)

ProvideAsyncNotifier provides an AsyncNotifier based on configuration.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL