server

package
v0.0.0-...-4f3c1ee Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalErrorResponse  = "Internal Server Error"
	ForbiddenErrorResponse = "Forbidden"
)
View Source
const (
	NoErrorIdentifier = iota
	InternalErrorIdentifier
	UserAgentForbiddenIdentifier
	TlsFingerprintForbiddenIdentifier
	IPForbiddenIdentifier
	RateLimitedErrorIdentifier
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host    string `env:"HOST" envDefault:"0.0.0.0"`
	Port    int    `env:"PORT" envDefault:"80"`
	TlsPort int    `env:"TLS_PORT" envDefault:"443"`
}

type Server

type Server struct {
	Config       *Config
	RoutingTable *router.RoutingTable
}

func New

func New(config *Config) *Server

New creates a new Server instance.

func (Server) Run

func (s Server) Run(ctx context.Context) error

Run starts the HTTP and HTTPS servers.

func (Server) UpdateRoutingTable

func (s Server) UpdateRoutingTable(payload watcher.Payload)

UpdateRoutingTable updates the server's routing table based on the provided payload.

Jump to

Keyboard shortcuts

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