server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UP   health = "UP"
	DOWN health = "DOWN"
)

Variables

View Source
var ErrInternal = errors.New("internal server error")

Functions

This section is empty.

Types

type NamedMonitor

type NamedMonitor interface {
	Name() string
	Monitor(ctx context.Context) error
}

type Option

type Option func(*Server)

func WithAddr

func WithAddr(addr string) Option

func WithContext

func WithContext(ctx context.Context) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

func WithMetricsHandler added in v0.2.1

func WithMetricsHandler(metricsHandler http.Handler) Option

func WithNamedMonitors

func WithNamedMonitors(monitors ...NamedMonitor) Option

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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