config

package
v0.36.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Enabled: false,
	Routes:  []Route{},
}

DefaultConfig is the default configuration for Lite mode.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled bool
	Routes  []Route
}

Config is the configuration for Lite mode.

func (Config) Validate

func (c Config) Validate() (warns []error, errs []error)

type Route

type Route struct {
	Host              configutil.SingleOrMulti[string] `json:"host" yaml:"host"`
	Backend           configutil.SingleOrMulti[string] `json:"backend" yaml:"backend"`
	CachePingTTL      configutil.Duration              `json:"cachePingTTL,omitempty" yaml:"cachePingTTL,omitempty"` // 0 = default, < 0 = disabled
	Fallback          *Status                          `json:"fallback,omitempty" yaml:"fallback,omitempty"`         // nil = disabled
	ProxyProtocol     bool                             `json:"proxyProtocol,omitempty" yaml:"proxyProtocol,omitempty"`
	RealIP            bool                             `json:"realIP,omitempty" yaml:"realIP,omitempty"`
	ModifyVirtualHost bool                             `json:"modifyVirtualHost,omitempty" yaml:"modifyVirtualHost,omitempty"`
}

func (*Route) CachePingEnabled added in v0.26.0

func (r *Route) CachePingEnabled() bool

CachePingEnabled returns true if the route has a ping cache enabled.

func (*Route) GetCachePingTTL added in v0.26.0

func (r *Route) GetCachePingTTL() time.Duration

GetCachePingTTL returns the configured ping cache TTL or a default duration if not set.

type Status added in v0.31.0

type Status struct {
	MOTD    *configutil.TextComponent `yaml:"motd,omitempty" json:"motd,omitempty"`
	Version ping.Version              `yaml:"version,omitempty" json:"version,omitempty"`
	Favicon favicon.Favicon           `yaml:"favicon,omitempty" json:"favicon,omitempty"`
	ModInfo modinfo.ModInfo           `yaml:"modInfo,omitempty" json:"modInfo,omitempty"`
}

func (*Status) Response added in v0.31.0

func (s *Status) Response(proto.Protocol) (*ping.ServerPing, error)

Response returns the configured status response.

Jump to

Keyboard shortcuts

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