config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package config defines the necessary types to configure the application. An example config file config.yaml is provided in the repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Type   CheckType  `yaml:"type" default:"Contains"`
	Source SourceType `yaml:"source" default:"ResponseBody"`
	Value  string     `yaml:"value"`
}

type CheckType

type CheckType string
const (
	ContainsCheckType          CheckType = "Contains"
	RegularExpressionCheckType CheckType = "RegularExpression"
	SuffixCheckType            CheckType = "Suffix"
	PrefixCheckType            CheckType = "Prefix"
	EqualCheckType             CheckType = "Equal"
)

type Config

type Config struct {
	commoncfg.BaseConfig `mapstructure:",squash"`

	Server       Server        `yaml:"server"`
	Healthcheck  Healthcheck   `yaml:"healthcheck"`
	Healthchecks []Healthcheck `yaml:"healthchecks"`
	Versions     Versions      `yaml:"versions"`
}

type Domain added in v0.3.0

type Domain struct {
	Enabled   bool       `yaml:"enabled"`
	Tag       string     `yaml:"tag"`
	Resources []Resource `yaml:"resources"`
}

type Healthcheck

type Healthcheck struct {
	Enabled         bool          `yaml:"enabled" default:"false"`
	Name            string        `yaml:"name" default:"healthcheck"`
	Endpoint        string        `yaml:"endpoint" default:"/healthz"`
	RefreshDuration time.Duration `yaml:"refreshDuration" default:"5s"`
	Cluster         Domain        `yaml:"cluster"`
	Kubernetes      Domain        `yaml:"kubernetes"`
	Linkerd         Linkerd       `yaml:"linkerd"`
}

type Linkerd

type Linkerd struct {
	Enabled               bool     `yaml:"enabled"`
	Tag                   string   `yaml:"tag" default:"linkerd"`
	ControlPlaneNamespace string   `yaml:"controlPlaneNamespace" default:"linkerd"`
	DataPlaneNamespace    string   `yaml:"dataPlaneNamespace" default:"linkerd"`
	CNINamespace          string   `yaml:"cniNamespace" default:"linkerd-cni"`
	RetryDeadline         int      `yaml:"retryDeadline" default:"300"`
	CNIEnabled            bool     `yaml:"cniEnabled"`
	Output                string   `yaml:"output" default:"short"`
	Checks                []string `yaml:"checks"`
	Retry                 Retry    `yaml:"retry"`
}

type Resource added in v0.3.0

type Resource struct {
	Name   string  `yaml:"name"`
	URL    string  `yaml:"url"`
	Checks []Check `yaml:"checks"`
	Retry  Retry   `yaml:"retry"`
}

type Retry added in v0.3.0

type Retry struct {
	MaxRetries int `yaml:"maxRetries" default:"0"`
}

type Server

type Server struct {
	// HTTP.Address is the address to listen on for HTTP requests
	Address         string        `yaml:"address" default:":8080"`
	ShutdownTimeout time.Duration `yaml:"shutdownTimeout" default:"5s"`
}

type ServiceResource

type ServiceResource struct {
	Name string `yaml:"name"`
	URL  string `yaml:"url"`
}

type SourceType

type SourceType string
const (
	ResponseBodySourceType   SourceType = "ResponseBody"
	ResponseStatusSourceType SourceType = "ResponseStatus"
)

type Versions

type Versions struct {
	Enabled   bool               `yaml:"enabled" default:"false"`
	Endpoint  string             `yaml:"endpoint" default:"/versions"`
	Timeout   time.Duration      `yaml:"timeout" default:"5s"`
	Resources []*ServiceResource `yaml:"resources" default:"[]"`
}

Jump to

Keyboard shortcuts

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