Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NtfyHandler ¶
type NtfyHandler struct {
// contains filtered or unexported fields
}
NtfyHandler is a slog.Handler that sends log messages to a ntfy server.
func New ¶
func New(opts *Options) *NtfyHandler
New creates a new NtfyHandler from the provided options.
func (*NtfyHandler) Enabled ¶
Enabled reports whether the handler handles records at the given level.
type Options ¶
type Options struct {
// AddSource causes the handler to compute the source code position
// of the log statement and add a SourceKey attribute to the output.
AddSource bool
// Level reports the minimum record level that will be logged.
Level slog.Leveler
// Server is the server address for the ntfy service.
Server string
// Topic is the topic name for the ntfy service.
Topic string
// Token is the authentication token for the ntfy service.
Token string
}
Click to show internal directories.
Click to hide internal directories.