server

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: Apache-2.0 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
	Add(name string, opts ...ServerOption) error
	Get(name string) (Server, error)
	List() []Server
	RegisterRouters(routers ...api.Router) error
	RegisterMiddlewares(middlewares ...api.Middleware) 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
	Routers() []*api.HandlerGroup
	HandlerPath(group *api.HandlerGroup, handler *api.Handler) string
}

Server represents a single echo server instance

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 WithTLS

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

func WithThrottle

func WithThrottle(rps float64, burstSize int) ServerOption

Jump to

Keyboard shortcuts

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