rest

package module
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: BSD-3-Clause Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Default router.Handler
	Logger  *slog.Logger
	Metrics *metrics.Metrics
	Verbose bool
	Debug   bool
}

func (Config) WithOptions

func (c Config) WithOptions(opts []Option) (Config, error)

type Option

type Option func(s Config) (Config, error)

func WithDebug

func WithDebug(on bool) Option

func WithDefault

func WithDefault(r router.Handler) Option

func WithLogger

func WithLogger(l *slog.Logger) Option

func WithMetrics

func WithMetrics(m *metrics.Metrics) Option

func WithVerbose

func WithVerbose(on bool) Option

type Service

type Service struct {
	router.Router
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Service, error)

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, req *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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