Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct {
// log level (default: debug)
Level slog.Leveler
// execute when error occurs
ErrHandler func(body any, err error)
// optional: customize record builder
Converter func(record *slog.Record) any
// 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
}
type WebhookHandler ¶
type WebhookHandler struct {
slog.Handler
WebhookURL string
// contains filtered or unexported fields
}
func NewWebhookHandler ¶
func NewWebhookHandler(webhookURL string, option Option) *WebhookHandler
func (*WebhookHandler) Close ¶
func (h *WebhookHandler) Close()
Click to show internal directories.
Click to hide internal directories.