config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	URL  string `yaml:"url"`
	Auth struct {
		Username string `yaml:"username"`
		Password string `yaml:"password"`
	} `yaml:"auth"`
}

type Config

type Config struct {
	Bind            string        `default:"0.0.0.0:8080"       env:"BIND"      yaml:"bind"`
	Backend         *Backend      `yaml:"backend"`
	EnableIPv6      bool          `default:"false"              yaml:"ipv6"`
	HTTPErrorCode   int           `yaml:"httpErrorCode"`
	Selector        LabelSelector `yaml:"selector,omitempty"`
	Timeout         time.Duration `yaml:"timeout"`
	TimeoutShutdown time.Duration `yaml:"timeoutShutdown"`
	Concurrency     int           `yaml:"concurrency"`
	Metadata        bool          `default:"true"               yaml:"metadata"`
	MaxConnDuration time.Duration `yaml:"maxConnectionDuration"`
	MaxConnsPerHost int           `yaml:"maxConnectionsPerHost"`
	Tenant          *TenantConfig `yaml:"tenant"`
	PipeIn          *fhu.InmemoryListener
	PipeOut         *fhu.InmemoryListener
}

func Load

func Load(file string) (*Config, error)

type LabelSelector

type LabelSelector struct {
	MatchLabels      map[string]string          `yaml:"matchLabels,omitempty"`
	MatchExpressions []LabelSelectorRequirement `yaml:"matchExpressions,omitempty"`
}

func (*LabelSelector) Selector

func (l *LabelSelector) Selector() *metav1.LabelSelector

type LabelSelectorRequirement

type LabelSelectorRequirement struct {
	Key      string   `yaml:"key"`
	Operator string   `yaml:"operator"`
	Values   []string `yaml:"values,omitempty"`
}

type TenantConfig

type TenantConfig struct {
	Labels                []string `yaml:"labels"`
	SetNamespaceAsDefault bool     `default:"false"         yaml:"setNamespaceAsDefault"`
	Prefix                string   `yaml:"prefix"`
	PrefixPreferSource    bool     `default:"false"         yaml:"prefixPreferSource"`
	LabelRemove           bool     `default:"false"         yaml:"labelRemove"`
	Header                string   `default:"X-Scope-OrgID" yaml:"header"`
	SetHeader             bool     `default:"true"          yaml:"setHeader"`
	TenantLabel           string   `yaml:"tenantLabel"`

	Default   string `yaml:"default"`
	AcceptAll bool   `default:"true" yaml:"acceptAll"`
}

Jump to

Keyboard shortcuts

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