config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 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 Cluster

type Cluster struct {
	Enabled   bool              `yaml:"enabled"`
	Tag       string            `yaml:"tag" default:"cluster"`
	Resources []ClusterResource `yaml:"resources"`
}

type ClusterResource

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

type Config

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

	Server      Server      `yaml:"server"`
	Healthcheck Healthcheck `yaml:"healthcheck"`
	Versions    Versions    `yaml:"versions"`
}

type Healthcheck

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

type Kubernetes

type Kubernetes struct {
	Enabled   bool                 `yaml:"enabled"`
	Tag       string               `yaml:"tag" default:"kubernetes"`
	Resources []KubernetesResource `yaml:"resources"`
}

type KubernetesResource

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

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"`
}

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"`
	Resources []*ServiceResource `yaml:"resources" default:"[]"`
}

Jump to

Keyboard shortcuts

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