config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerConfigs []ServerConfig `yaml:"servers"`
	MetricsConfig HostConfig     `yaml:"metrics"`
}

func GenerateConfig

func GenerateConfig(listener string, targets []string, metrics string) (*Config, error)

func New

func New(configPath string) (*Config, error)

type ConnectionConfig added in v1.1.0

type ConnectionConfig struct {
	ConnectTimeout         int    `yaml:"connectTimeout"` // TODO: Implement connect timeout
	Timeout                string `yaml:"timeout"`
	IdleTimeout            int    `yaml:"idleTimeout"` // TODO: Implement idle timeout
	ConnectTimeoutDuration time.Duration
	TimeoutDuration        time.Duration
	IdleTimeoutDuration    time.Duration
}

type HostConfig

type HostConfig struct {
	Host             string `yaml:"host"`
	Port             string `yaml:"port"`
	ConnectionConfig `yaml:"connection"`
	TLSConfig        `yaml:"tls"`
}

type Role

type Role struct {
	Server bool
}

type ServerConfig

type ServerConfig struct {
	Name     string       `yaml:"name"`
	Listener HostConfig   `yaml:"listener"`
	Targets  []HostConfig `yaml:"targets"`
	Mirror   HostConfig   `yaml:"mirror"`
}

type SubjectAltName added in v1.1.0

type SubjectAltName struct {
	IPAddress []string
	Uri       []string
	DNS       []string
}

type TLSConfig

type TLSConfig struct {
	CaCert          string   `yaml:"caCert"`
	Cert            string   `yaml:"cert"`
	Key             string   `yaml:"key"`
	Mode            string   `yaml:"mode"`
	SubjectAltNames []string `yaml:"subjectAltNames"`
	SubjectAltName
	Role
}

func (TLSConfig) IsMutual

func (t TLSConfig) IsMutual() bool

func (TLSConfig) IsSimple

func (t TLSConfig) IsSimple() bool

Jump to

Keyboard shortcuts

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