httpserver

package
v0.0.0-...-fce1e31 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 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 {
	Port               int           `koanf:"port"`
	Cors               Cors          `koanf:"cors"`
	ShutDownCtxTimeout time.Duration `koanf:"shutdown_context_timeout"`
}

type Cors

type Cors struct {
	AllowOrigins []string `koanf:"allow_origins"`
	AllowHeaders []string `koanf:"allow_headers"`
	Skip         bool     `koanf:"skip"`
}

type Server

type Server struct {
	Router *echo.Echo
	Config Config
}

func New

func New(cfg Config) Server

func (Server) RegisterHandler

func (s Server) RegisterHandler(route string, handler echo.HandlerFunc)

register custom handler

func (Server) Start

func (s Server) Start() error

start server

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