Documentation
¶
Index ¶
- type Handler
- func (h *Handler) HomeHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HookHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) MessageHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Register(mux *http.ServeMux)
- func (h *Handler) UnknownHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) WebhookHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) WebhookPageHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) WebhooksPageHandler(w http.ResponseWriter, r *http.Request)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles incoming HTTP requests.
func NewHandler ¶
func NewHandler(storage storage.WebhookStorage, options ...Option) *Handler
NewHandler creates and initializes handler.
func (*Handler) HomeHandler ¶
func (h *Handler) HomeHandler(w http.ResponseWriter, r *http.Request)
HomeHandler renders the landing page.
func (*Handler) HookHandler ¶
func (h *Handler) HookHandler(w http.ResponseWriter, r *http.Request)
HookHandler accepts incoming webhook deliveries on /hooks/{id}[/*].
func (*Handler) MessageHandler ¶
func (h *Handler) MessageHandler(w http.ResponseWriter, r *http.Request)
MessageHandler handles requests for the captured-messages endpoint.
func (*Handler) UnknownHandler ¶
func (h *Handler) UnknownHandler(w http.ResponseWriter, r *http.Request)
UnknownHandler handles requests for unknown endpoints and returns 404
func (*Handler) WebhookHandler ¶
func (h *Handler) WebhookHandler(w http.ResponseWriter, r *http.Request)
WebhookHandler handles request for webhook endpoint. POST creates a new webhook.
func (*Handler) WebhookPageHandler ¶
func (h *Handler) WebhookPageHandler(w http.ResponseWriter, r *http.Request)
WebhookPageHandler renders a detail page for a single webhook.
func (*Handler) WebhooksPageHandler ¶
func (h *Handler) WebhooksPageHandler(w http.ResponseWriter, r *http.Request)
WebhooksPageHandler handles the HTML form for creating webhooks.
type Option ¶
type Option func(*Handler)
Option configures a handler.
func WithClientIPHeader ¶
WithClientIPHeader configures an optional request header that contains the client IP.
func WithPublicBaseURL ¶
WithPublicBaseURL sets the absolute base URL returned in webhook capability URLs.