Documentation ΒΆ
Index ΒΆ
- func Failover() func(...slog.Handler) slog.Handler
- func Fanout(handlers ...slog.Handler) slog.Handler
- func Pool() func(...slog.Handler) slog.Handler
- func Router() *router
- type EnabledInlineMiddleware
- func (h *EnabledInlineMiddleware) Enabled(ctx context.Context, level slog.Level) bool
- func (h *EnabledInlineMiddleware) Handle(ctx context.Context, record slog.Record) error
- func (h *EnabledInlineMiddleware) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *EnabledInlineMiddleware) WithGroup(name string) slog.Handler
- type FailoverHandler
- type FanoutHandler
- type HandleInlineMiddleware
- func (h *HandleInlineMiddleware) Enabled(ctx context.Context, level slog.Level) bool
- func (h *HandleInlineMiddleware) Handle(ctx context.Context, record slog.Record) error
- func (h *HandleInlineMiddleware) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *HandleInlineMiddleware) WithGroup(name string) slog.Handler
- type InlineMiddleware
- type Middleware
- func NewEnabledInlineMiddleware(enabledFunc func(ctx context.Context, level slog.Level, ...) bool) Middleware
- func NewHandleInlineMiddleware(handleFunc func(ctx context.Context, record slog.Record, ...) error) Middleware
- func NewInlineMiddleware(enabledFunc func(ctx context.Context, level slog.Level, ...) bool, ...) Middleware
- func NewWithAttrsInlineMiddleware(...) Middleware
- func NewWithGroupInlineMiddleware(withGroupFunc func(name string, next func(string) slog.Handler) slog.Handler) Middleware
- type PipeBuilder
- type PoolHandler
- type RoutableHandler
- type TCPClient
- type WithAttrsInlineMiddleware
- func (h *WithAttrsInlineMiddleware) Enabled(ctx context.Context, level slog.Level) bool
- func (h *WithAttrsInlineMiddleware) Handle(ctx context.Context, record slog.Record) error
- func (h *WithAttrsInlineMiddleware) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *WithAttrsInlineMiddleware) WithGroup(name string) slog.Handler
- type WithGroupInlineMiddleware
- func (h *WithGroupInlineMiddleware) Enabled(ctx context.Context, level slog.Level) bool
- func (h *WithGroupInlineMiddleware) Handle(ctx context.Context, record slog.Record) error
- func (h *WithGroupInlineMiddleware) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *WithGroupInlineMiddleware) WithGroup(name string) slog.Handler
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
Types ΒΆ
type EnabledInlineMiddleware ΒΆ
type EnabledInlineMiddleware struct {
// contains filtered or unexported fields
}
type FailoverHandler ΒΆ
type FailoverHandler struct {
// contains filtered or unexported fields
}
@TODO: implement round robin strategy ?
type FanoutHandler ΒΆ
type FanoutHandler struct {
// contains filtered or unexported fields
}
type HandleInlineMiddleware ΒΆ
type HandleInlineMiddleware struct {
// contains filtered or unexported fields
}
type InlineMiddleware ΒΆ
type InlineMiddleware struct {
// contains filtered or unexported fields
}
type Middleware ΒΆ
Middleware defines the handler used by slog.Handler as return value.
func NewEnabledInlineMiddleware ΒΆ
func NewEnabledInlineMiddleware(enabledFunc func(ctx context.Context, level slog.Level, next func(context.Context, slog.Level) bool) bool) Middleware
NewEnabledInlineMiddleware is shortcut to a middleware that implements only the `Enable` method.
func NewHandleInlineMiddleware ΒΆ
func NewHandleInlineMiddleware(handleFunc func(ctx context.Context, record slog.Record, next func(context.Context, slog.Record) error) error) Middleware
NewHandleInlineMiddleware is a shortcut to a middleware that implements only the `Handle` method.
func NewInlineMiddleware ΒΆ
func NewInlineMiddleware( enabledFunc func(ctx context.Context, level slog.Level, next func(context.Context, slog.Level) bool) bool, handleFunc func(ctx context.Context, record slog.Record, next func(context.Context, slog.Record) error) error, withAttrsFunc func(attrs []slog.Attr, next func([]slog.Attr) slog.Handler) slog.Handler, withGroupFunc func(name string, next func(string) slog.Handler) slog.Handler, ) Middleware
NewInlineMiddleware is a shortcut to a middleware that implements all methods.
func NewWithAttrsInlineMiddleware ΒΆ
func NewWithAttrsInlineMiddleware(withAttrsFunc func(attrs []slog.Attr, next func([]slog.Attr) slog.Handler) slog.Handler) Middleware
NewWithAttrsInlineMiddleware is a shortcut to a middleware that implements only the `WithAttrs` method.
func NewWithGroupInlineMiddleware ΒΆ
func NewWithGroupInlineMiddleware(withGroupFunc func(name string, next func(string) slog.Handler) slog.Handler) Middleware
NewWithGroupInlineMiddleware is a shortcut to a middleware that implements only the `WithAttrs` method.
type PipeBuilder ΒΆ
type PipeBuilder struct {
// contains filtered or unexported fields
}
Pipe defines a chain of Middleware.
func Pipe ΒΆ
func Pipe(middlewares ...Middleware) *PipeBuilder
Pipe builds a chain of Middleware. Eg: rewrite log.Record on the fly for privacy reason.
func (*PipeBuilder) Handler ΒΆ
func (h *PipeBuilder) Handler(handler slog.Handler) slog.Handler
Implements slog.Handler
func (*PipeBuilder) Pipe ΒΆ
func (h *PipeBuilder) Pipe(middleware Middleware) *PipeBuilder
Implements slog.Handler
type PoolHandler ΒΆ
type PoolHandler struct {
// contains filtered or unexported fields
}
type RoutableHandler ΒΆ
type RoutableHandler struct {
// contains filtered or unexported fields
}
@TODO: implement round robin strategy ?
type TCPClient ΒΆ added in v0.0.4
func (*TCPClient) SetMaxRetries ΒΆ added in v0.0.4
func (*TCPClient) SetRetryInterval ΒΆ added in v0.0.4
type WithAttrsInlineMiddleware ΒΆ
type WithAttrsInlineMiddleware struct {
// contains filtered or unexported fields
}
type WithGroupInlineMiddleware ΒΆ
type WithGroupInlineMiddleware struct {
// contains filtered or unexported fields
}