Documentation
¶
Index ¶
- func Handler(hook Webhook) http.Handler
- func Run(hook Webhook, addr string, path string) error
- func RunServer(s *http.Server, hook Webhook, path string) error
- func RunTLSServer(s *http.Server, hook Webhook, path string) error
- type Header
- type Logger
- type ProcessPayloadFunc
- type Provider
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunTLSServer ¶
RunTLSServer runs a custom server with TLS configuration. NOTE: http.Server Handler will be overridden by this library, just set it to nil. Setting the Certificates can be done in the http.Server.TLSConfig.Certificates see example here: https://github.com/go-playground/webhooks/blob/v2/webhooks_test.go#L178
Types ¶
type Logger ¶
type Logger interface { // Info prints basic information. Info(...interface{}) // Error prints error information. Error(...interface{}) // Debug prints information usefull for debugging. Debug(...interface{}) }
Logger allows for customizable logging
DefaultLog contains the default logger for webhooks, and prints only info and error messages by default for debugs override DefaultLog or see NewLogger for creating one without debugs.
type ProcessPayloadFunc ¶
type ProcessPayloadFunc func(payload interface{}, header Header)
ProcessPayloadFunc is a common function for payload return values
Click to show internal directories.
Click to hide internal directories.