httpsrv

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(param ServerParam) *http.Server

Types

type Config

type Config struct {
	Port                   int           `env:"PORT, default=8888"`
	HTTPServerReadTimeout  time.Duration `env:"HTTP_SERVER_READ_TIMEOUT, default=1s"`
	HTTPServerWriteTimeout time.Duration `env:"HTTP_SERVER_WRITE_TIMEOUT, default=1s"`
}

type RouterRegistrar

type RouterRegistrar interface {
	MustRegisterRoutes(g *gin.Engine)
}

type ServerParam

type ServerParam struct {
	fx.In

	Conf         Config
	Slog         *slog.Logger
	Routerers    []RouterRegistrar `group:"http.controllers"`
	ServerConfig config.ServerConfig
}

Jump to

Keyboard shortcuts

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