webhook

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPNotifier

type HTTPNotifier struct {
	WebhookURLs []string
}

HTTPNotifier is a webhook dispatcher capable of notifying multiple subscribers via HTTP.

func NewHTTPNotifier

func NewHTTPNotifier(webhookURLs []string) HTTPNotifier

NewHTTPNotifier returns a new instance of an HTTPNotifier.

func (HTTPNotifier) Notify

func (n HTTPNotifier) Notify(topic string, message []byte) error

Notify sends the given message to all of the WebhookURLs. Topic is appended to the end of the webhook (subscriber) URL. E.g. localhost:8080/topic If multiple errors are encountered, then the first one is returned.

type Notifier

type Notifier interface {
	Notify(topic string, message []byte) error
}

Notifier represents a webhook dispatcher.

Jump to

Keyboard shortcuts

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