pusher

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilConfig = errors.New("pusher config is nil")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	AppID   string `env:"APP_ID"  json:"appID"`
	Key     string `env:"KEY"     json:"key"`
	Secret  string `env:"SECRET"  json:"secret"`
	Cluster string `env:"CLUSTER" json:"cluster"`
	Secure  bool   `env:"SECURE"  json:"secure"`
}

Config holds Pusher async notifier configuration.

func (*Config) ValidateWithContext

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

ValidateWithContext validates a Config struct.

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

Notifier is a Pusher-backed AsyncNotifier.

func NewNotifier

func NewNotifier(cfg *Config, logger logging.Logger, tracerProvider tracing.TracerProvider, metricsProvider metrics.Provider) (*Notifier, error)

NewNotifier creates a new Pusher-backed AsyncNotifier.

func (*Notifier) Close

func (n *Notifier) Close() error

Close is a no-op for the Pusher notifier (stateless HTTP API).

func (*Notifier) Publish

func (n *Notifier) Publish(ctx context.Context, channel string, event *async.Event) error

Publish sends an event to the given Pusher channel.

type PusherClient

type PusherClient interface {
	Trigger(channel string, eventName string, data any) error
}

PusherClient abstracts the Pusher SDK client for testability.

Jump to

Keyboard shortcuts

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