http

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server) error

Option enables variadic option passing to the server on startup.

func WithLogger

func WithLogger(l hclog.Logger) Option

WithLogger sets the logger for the server.

func WithStartupWG

func WithStartupWG(wg *sync.WaitGroup) Option

WithStartupWG allows a waitgroup to be passed in so the server can notify when its finished with startup tasks to allow a nice message to be printed to the console.

type Server

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

Server manages the HTTP serving components

func NewServer

func NewServer(opts ...Option) (*Server, error)

NewServer returns a running field controller.

func (*Server) Mount added in v0.1.9

func (s *Server) Mount(path string, router chi.Router)

Mount attaches a set of routes to the subpath specified by the path argument.

func (*Server) Serve

func (s *Server) Serve(bind string) error

Serve binds and serves http on the bound socket. An error will be returned if the server cannot initialize.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server.

Jump to

Keyboard shortcuts

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