Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = "extra"
View Source
var ErrorKeys = []string{"error", "err"}
View Source
var RequestIgnoreHeaders = false
View Source
var RequestKey = "request"
View Source
var SourceKey = "source"
Functions ¶
Types ¶
type Option ¶
type Option struct {
// log level (default: debug)
Level slog.Leveler
// URL
Endpoint string
Timeout time.Duration // default: 10s
// optional: customize webhook event builder
Converter Converter
// optional: custom marshaler
Marshaler func(v any) ([]byte, error)
// optional: fetch attributes from context
AttrFromContext []func(ctx context.Context) []slog.Attr
// optional: see slog.HandlerOptions
AddSource bool
ReplaceAttr func(groups []string, a slog.Attr) slog.Attr
}
func (Option) NewWebhookHandler ¶
Click to show internal directories.
Click to hide internal directories.