httpserver

package
v0.0.0-...-80aead2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 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 {
	Host            string        `koanf:"host"`
	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) Stop

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

Jump to

Keyboard shortcuts

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