httpserver

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package httpserver connects a standard HTTP server to the application lifecycle. Any router that implements http.Handler can be used as the server's handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func New

func New(server *http.Server) *Server

func NewForEnvironment added in v0.1.1

func NewForEnvironment(server *http.Server, logger logging.Logger, env pfw.Environment) *Server

NewForEnvironment is the default DI provider for environment-aware initializers.

func NewWithLogger added in v0.1.1

func NewWithLogger(server *http.Server, logger logging.Logger) *Server

NewWithLogger is the default DI provider for initializers without an environment.

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the bound address after Start, useful when binding to port zero.

func (*Server) HTTPServer added in v0.1.1

func (s *Server) HTTPServer() *http.Server

HTTPServer returns the underlying application's HTTP server.

func (*Server) Logger added in v0.1.1

func (s *Server) Logger() logging.Logger

Logger returns the logger injected into this lifecycle component.

func (*Server) Start

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

Start binds the listener before returning, so bind failures are startup errors.

func (*Server) Stop

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

Stop drains requests and forcibly closes connections if its deadline expires.

func (*Server) Wait

func (s *Server) Wait() error

Jump to

Keyboard shortcuts

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