notifier

package
v0.0.0-...-61eb987 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// MaxQueueBytes is the max memory used by the webhook notifier for inflight
	// events. Defaults to 100MiB
	MaxQueueBytes int64
	// URLWorkerCount is the max number of concurrent workers that will send
	// webhooks for a given event. Defaults to 10.
	URLWorkerCount uint
	// ClientTimeout is the max time the notifier will wait for a response from
	// a webhook url before it times out. Defaults to 10s.
	ClientTimeout time.Duration
}

type Notifier

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

Notifier represents the process that notifies any subscribed webhooks when the relevant events are triggered.

func New

func New(cfg *Config, store subscriptionRetriever, opts ...Option) *Notifier

func (*Notifier) Close

func (n *Notifier) Close() error

func (*Notifier) Name

func (n *Notifier) Name() string

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context) error

func (*Notifier) ProcessWALEvent

func (n *Notifier) ProcessWALEvent(ctx context.Context, walEvent *wal.Event) (err error)

type Option

type Option func(*Notifier)

func WithCheckpoint

func WithCheckpoint(c checkpointer.Checkpoint) Option

func WithLogger

func WithLogger(l loglib.Logger) Option

Jump to

Keyboard shortcuts

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