Documentation
¶
Index ¶
- Variables
- func Save(db *sql.DB, hook Hook) error
- func WebhookPublisherIgnoreDuplicates(errorAsserts ErrorAsserts) func(*WebhookPublisher)
- func WebhookPublisherSecret(secret string) func(*WebhookPublisher)
- func WebhookPublisherStatusAccepted(status int) func(*WebhookPublisher)
- func WebhookPublisherStatusCreated(status int) func(*WebhookPublisher)
- type ErrorAsserts
- type Hook
- type Parser
- type ParserFunc
- type WebhookPublisher
- type WebhookRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var BuiltinErrorAsserts = builtinErrorAsserts{}
Functions ¶
func WebhookPublisherIgnoreDuplicates ¶
func WebhookPublisherIgnoreDuplicates(errorAsserts ErrorAsserts) func(*WebhookPublisher)
func WebhookPublisherSecret ¶
func WebhookPublisherSecret(secret string) func(*WebhookPublisher)
func WebhookPublisherStatusAccepted ¶
func WebhookPublisherStatusAccepted(status int) func(*WebhookPublisher)
func WebhookPublisherStatusCreated ¶
func WebhookPublisherStatusCreated(status int) func(*WebhookPublisher)
Types ¶
type ErrorAsserts ¶
ErrorAsserts defines the error assertions used by publishers
type Parser ¶
type Parser interface {
Parse(request WebhookRequest, secret string) (hook *Hook, err error)
}
type ParserFunc ¶
type ParserFunc func(request WebhookRequest, secret string) (hook *Hook, err error)
The ParserFunc type is an adapter to allow the use of ordinary functions as Parsers. If f is a function with the appropriate signature, ParserFunc(f) is a Parser that returns f(request, secret).
func (ParserFunc) Parse ¶
func (f ParserFunc) Parse(request WebhookRequest, secret string) (hook *Hook, err error)
Parse returns f(request, secret).
type WebhookPublisher ¶
type WebhookPublisher struct {
// contains filtered or unexported fields
}
func NewWebhookPublisher ¶
func NewWebhookPublisher(db *sql.DB, parser Parser, options ...func(*WebhookPublisher)) WebhookPublisher
func (WebhookPublisher) Receive ¶
func (p WebhookPublisher) Receive(w http.ResponseWriter, r *http.Request) (status int, err error)
Click to show internal directories.
Click to hide internal directories.