Documentation
¶
Overview ¶
Package forward replays a webhook event verbatim, headers included, to a local handler.
Index ¶
Constants ¶
const ( CauseTLS = "tls" CauseTimeout = "timeout" CauseDown = "down" )
Why a forward got no answer.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
Forwarder POSTs webhook events to one local handler address.
func NewForwarder ¶
NewForwarder builds a Forwarder for addr (scheme defaults to http). skipTLSVerify is refused off loopback.
func (*Forwarder) IsLoopback ¶
IsLoopback reports whether the handler is on the local machine.
func (*Forwarder) IsPlaintextRemote ¶
IsPlaintextRemote reports whether the handler is off-machine over plain http.
func (*Forwarder) IsUnverifiedTLS ¶
IsUnverifiedTLS reports whether the handler's certificate goes unchecked.
type Result ¶
type Result struct {
StatusCode int
Latency time.Duration
Body []byte // bounded snippet, for a non-2xx diagnostic
}
Result is the outcome of forwarding one event.
type Unanswered ¶ added in v0.1.3
type Unanswered struct{ Cause string }
Unanswered is a forward that got no answer, kept as its cause so the cause survives a session writing it to disk and another reading it back.
func (*Unanswered) Error ¶ added in v0.1.3
func (u *Unanswered) Error() string