config

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 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    `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Routes  []Route `yaml:"routes,omitempty" json:"routes,omitempty"`
}

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,omitempty" yaml:"host,omitempty"`
	Backend       configutil.SingleOrMulti[string] `json:"backend,omitempty" yaml:"backend,omitempty"`
	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"`
	// Deprecated: use TCPShieldRealIP instead.
	RealIP            bool `json:"realIP,omitempty" yaml:"realIP,omitempty"`
	TCPShieldRealIP   bool `json:"tcpShieldRealIP,omitempty" yaml:"tcpShieldRealIP,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) Equal added in v0.37.1

func (r *Route) Equal(other *Route) bool

Equal returns true if the Routes are equal.

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.

func (*Route) GetTCPShieldRealIP added in v0.36.2

func (r *Route) GetTCPShieldRealIP() bool

GetTCPShieldRealIP returns the configured TCPShieldRealIP or deprecated RealIP value.

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