server

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	common.Service
	common.Initializable
	common.Daemon
	Get(name string) (Server, error)
	List() []Server
	RegisterRouters(routers ...api.Router) error
	RegisterMiddlewares(middlewares ...api.Middleware) error
	Add(name string, opts ...ServerOption) error
}

Manager manages multiple server instances.

func New

func New(opts ...Option) Manager

New creates a new server instance with the given options

type Option

type Option func(*manager)

func WithDebug added in v0.2.8

func WithDebug(enabled bool) Option

func WithLogger

func WithLogger(logger log.Logger) Option

type Server

type Server interface {
	common.Named
	Endpoint() *api.Endpoint
}

type ServerOption

type ServerOption func(*server)

ServerOption configures a server (echo server instance)

func WithEndpoint

func WithEndpoint(host string, port uint, prefix string) ServerOption

func WithMiddlewares added in v0.6.0

func WithMiddlewares(mws ...api.Middleware) ServerOption

WithMiddlewares installs middlewares on the server itself, ahead of the built-in chain and so ahead of any route match - where a concern that must answer requests no route matches, such as CORS preflight, has to sit. They run on every request to the server, are built with a nil config, and survive the echo rebuild a restart performs. RequestInfo does not exist yet at this position; a middleware that reads it belongs in router.yaml instead.

func WithTLS

func WithTLS(cert certutil.CertBundle, auth bool) ServerOption

Jump to

Keyboard shortcuts

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