httpserver

package
v0.0.0-...-b292b4c Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultShutdownTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CORS

type CORS struct {
	AllowOrigins []string `koanf:"allow_origins"`
}

type Config

type Config struct {
	Port            int           `koanf:"port"`
	CORS            CORS          `koanf:"cors"`
	ShutdownTimeout time.Duration `koanf:"shutdown_context_timeout"`
	HideBanner      bool          `koanf:"hide_banner"`
	HidePort        bool          `koanf:"hide_port"`

	// Optional Otel middleware can be injected from outside.
	OtelMiddleware echo.MiddlewareFunc
}

type Server

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

func New

func New(cfg Config) (*Server, error)

func (*Server) GetConfig

func (s *Server) GetConfig() *Config

func (*Server) GetRouter

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

func (*Server) Start

func (s *Server) Start() error

func (*Server) StopWithTimeout

func (s *Server) StopWithTimeout() error

Jump to

Keyboard shortcuts

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