config

package
v0.0.0-...-f0e227c Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromYAMLFile

func FromYAMLFile[T any, P interface {
	*T
	Validator
}](name string) (*T, error)

FromYAMLFile returns a new value of type T created from the given YAML config file.

func ParseFlags

func ParseFlags[T any, P interface{ *T }]() (*T, error)

ParseFlags parses CLI flags and returns a Flags value created from them.

Types

type Initer

type Initer interface {
	Init()
}

type TLS

type TLS struct {
	Enable   bool   `yaml:"tls"`
	Cert     string `yaml:"cert"`
	Key      string `yaml:"key"`
	Ca       string `yaml:"ca"`
	Insecure bool   `yaml:"insecure"`
}

TLS provides TLS configuration options.

func (*TLS) MakeConfig

func (t *TLS) MakeConfig(serverName string) (*tls.Config, error)

MakeConfig assembles a tls.Config from t and serverName.

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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