httpserver

package
v0.0.0-...-8e5b7c0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenIpAddress string
	ListenPort      string

	// Maximum headers with its values to parse in requests. If passed
	// zero it will be 1 << 20 (1 megabyte).
	MaxHeaderBytes int

	// Timeout for reading the requests. If passed zero it will be 15
	// (15 seconds).
	ReadTimeoutSeconds int

	// Timeout for writing the responses. If passed zero it will be 15
	// (15 seconds).
	WriteTimeoutSeconds int
}

type RoutesInitilizer

type RoutesInitilizer interface {
	InitRoutes(engine *gin.Engine)
}

type Server

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

func New

func New(cfg *Config) *Server

func (*Server) AddMW

func (s *Server) AddMW(mw ...gin.HandlerFunc)

func (*Server) InitRoutes

func (s *Server) InitRoutes(endpoints ...RoutesInitilizer)

func (*Server) Shutdown

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

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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