server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReadHeaderTimeout is the default timeout for reading request headers
	DefaultReadHeaderTimeout = 5 * time.Second
	// DefaultShutdownTimeout is the default timeout for graceful shutdown
	DefaultShutdownTimeout = 10 * time.Second
	// DefaultStartupTimeout is the default timeout for server startup
	DefaultStartupTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server handles HTTP server lifecycle and configuration

func New

func New(
	lc fx.Lifecycle,
	logger logging.Logger,
	cfg *config.Config,
	e *echo.Echo,
	middlewareManager *middleware.Manager,
) *Server

New creates a new server instance with the provided dependencies

func (*Server) Address added in v0.2.0

func (s *Server) Address() string

Address returns the server's address in host:port format

func (*Server) Config added in v0.1.5

func (s *Server) Config() *config.Config

Config returns the server configuration

func (*Server) Echo

func (s *Server) Echo() *echo.Echo

Echo returns the underlying echo instance

func (*Server) Start

func (s *Server) Start() error

Start starts the server and returns when it's ready to accept connections

func (*Server) URL added in v0.1.5

func (s *Server) URL() string

URL returns the server's full HTTP URL

Jump to

Keyboard shortcuts

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