Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Invoke ¶
Invoke invokes all the web hooks stored in the configuration, in parallel. It will block the calling goroutine. When it has a response from each of the configured targets, it will return either nil to indicate that the hooks all succeeded, or an error to indicate that at least one of the hooks failed.
Types ¶
type Header ¶
type Header struct { Name string `json:"name",yaml:"name"` Value string `json:"value",yaml:"value"` }
A Header is simply a key-value pair. Each web hook can optionally specify a set of headers that it will send on each request.
type WebHook ¶
type WebHook struct { URI string `json:"uri",yaml:"uri"` Headers map[string]string `json:"headers,omitempty",yaml:"headers,omitempty"` }
A WebHook defines a single hook. The URL describes what we will call. A WebHook will be implemented as an HTTP (or HTTPS) POST to the specified URI, with content type and content defined by the user of this package. The target must return a status code in the "200" to indicate that the hook succeeded. Anything else will be interpreted as an error.