Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPNotifier ¶
type HTTPNotifier struct {
// contains filtered or unexported fields
}
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 urls. 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 WSNotifier ¶
type WSNotifier struct {
// contains filtered or unexported fields
}
WSNotifier is a dispatcher capable of notifying multiple subscribers via WebSocket.
func NewWSNotifier ¶
func NewWSNotifier(path string) *WSNotifier
NewWSNotifier returns a new instance of an WSNotifier.
func (*WSNotifier) GetRESTHandlers ¶
func (n *WSNotifier) GetRESTHandlers() []rest.Handler
GetRESTHandlers returns all REST handlers provided by notifier.
type WebNotifier ¶
type WebNotifier struct {
// contains filtered or unexported fields
}
WebNotifier is a dispatcher capable of notifying multiple subscribers via HTTP Webhooks and WebSockets.
func New ¶
func New(wsPath string, webhookURLs []string) *WebNotifier
New returns a new instance of a WebNotifier.
func (*WebNotifier) GetRESTHandlers ¶
func (n *WebNotifier) GetRESTHandlers() []rest.Handler
GetRESTHandlers returns all REST handlers provided by notifier.