handler

package
v1.5.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Tape = "tape"
	Text = "text"
	Json = "json"
)

Variables

This section is empty.

Functions

func NewTapeHandler

func NewTapeHandler(w io.Writer, opts *slog.HandlerOptions) slog.Handler

NewTapeHandler creates a tape handler with w and opts. This handler is more readable and faster than slog's handlers.

func Register

func Register(name string, newHandler NewHandlerFunc) error

Register registers newHandler with name.

Types

type NewHandlerFunc

type NewHandlerFunc func(w io.Writer, opts *slog.HandlerOptions) slog.Handler

NewHandlerFunc is a function for creating slog.Handler with w and opts.

func Get

func Get(name string) (NewHandlerFunc, error)

Get gets new handler func with name and returns an error if failed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL