server

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package server provides HTTP server setup and lifecycle management for the application.

Index

Constants

View Source
const (
	// StartupTimeout is the timeout for server startup
	StartupTimeout = 5 * time.Second
	// ShutdownTimeout is the timeout for graceful shutdown
	ShutdownTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps added in v0.1.5

type Deps struct {
	fx.In
	Lifecycle   fx.Lifecycle
	Logger      logging.Logger
	Config      *config.Config
	Echo        *echo.Echo
	AssetServer web.AssetServer
}

Deps contains the dependencies for creating a server

type Server

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

Server handles HTTP server lifecycle and configuration

func New

func New(deps Deps) *Server

New creates a new server instance with the provided dependencies

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(ctx context.Context) 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