stomp

package
v4.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 18 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 {
	// Configures the STOMP delivery to deliver notifications directly to
	// the configured Destination.
	//
	// If true "Callback" is ignored.
	// If false a notifier.Callback is delivered to the queue and clients
	// utilize the pagination API to retrieve.
	Direct bool `yaml:"direct"`
	// Specifies the number of notifications delivered in single STOMP message
	// when Direct is true.
	//
	// Ignored if Direct is not true
	// If 0 or 1 is provided no rollup occurs and each notification is delivered
	// separately.
	Rollup int `yaml:"rollup"`
	// The callback url where notifications are retrieved.
	Callback string `yaml:"callback"`

	// the destination messages will be delivered to
	Destination string `yaml:"destination"`
	// a list of URIs to send messages to.
	// a linear search of this list is always performed.
	URIs []string `yaml:"uris"`
	// optional tls portion of config
	TLS *TLS `yaml:"tls"`

	// optional user login portion of config
	Login *Login `yaml:"user"`
	// contains filtered or unexported fields
}

func (*Config) Validate

func (c *Config) Validate() (Config, error)

type Deliverer

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

Deliverer is a STOMP deliverer which publishes a notifier.Callback to the the broker.

func New

func New(conf Config) (*Deliverer, error)

func (*Deliverer) Deliver

func (d *Deliverer) Deliver(ctx context.Context, nID uuid.UUID) error

func (*Deliverer) Name

func (d *Deliverer) Name() string

type DirectDeliverer

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

Deliverer is a STOMP deliverer which publishes a notifier.Callback to the the broker.

func NewDirectDeliverer

func NewDirectDeliverer(conf Config) (*DirectDeliverer, error)

func (*DirectDeliverer) Deliver

func (d *DirectDeliverer) Deliver(ctx context.Context, nID uuid.UUID) error

func (*DirectDeliverer) Name

func (d *DirectDeliverer) Name() string

func (*DirectDeliverer) Notifications

func (d *DirectDeliverer) Notifications(ctx context.Context, n []notifier.Notification) error

Notifications will copy the provided notifications into a buffer for STOMP delivery.

type Login

type Login struct {
	Login    string `yaml:"login"`
	Passcode string `yaml:"passcode"`
}

type TLS

type TLS struct {
	// The filesystem path where a root CA can be read.
	RootCA string `yaml:"root_ca"`
	// The filesystem path where a tls certificate can be read.
	Cert string `yaml:"cert"`
	// The filesystem path where a tls private key can be read.
	Key string `yaml:"key"`
}

Jump to

Keyboard shortcuts

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