server

package
v0.0.0-...-6b385f4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootHandler

func NewRootHandler(deps RootHandlerDeps) http.Handler

Types

type HTTPServer

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

func NewHTTPServer

func NewHTTPServer(deps HTTPServerDeps) *HTTPServer

NewHTTPServer constructor factory for general use *http.Server.

func (*HTTPServer) Start

func (srv *HTTPServer) Start(ctx context.Context) error

type HTTPServerDeps

type HTTPServerDeps struct {
	dig.In

	RootLogger *slog.Logger

	// config
	Port              int           `name:"config.httpServer.port"`
	IdleTimeout       time.Duration `name:"config.httpServer.idleTimeout"`
	ReadHeaderTimeout time.Duration `name:"config.httpServer.readHeaderTimeout"`
	ReadTimeout       time.Duration `name:"config.httpServer.readTimeout"`
	WriteTimeout      time.Duration `name:"config.httpServer.writeTimeout"`

	Handler http.Handler

	// services
	*services.ShutdownHooks
}

type RootHandlerDeps

type RootHandlerDeps struct {
	dig.In

	RootLogger *slog.Logger
	Groups     []routes.MountFunc `group:"server"`
}

Jump to

Keyboard shortcuts

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