config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTLSConfig = errors.New("TLS config is not present")

Functions

func LoadTLSConfig

func LoadTLSConfig(configPath string) (*tls.Config, error)

func LoadTLSConfigFromReader

func LoadTLSConfigFromReader(configPath string, reader io.Reader) (*tls.Config, error)

Types

type ExporterConfig

type ExporterConfig struct {
	Enabled   bool       `yaml:"enabled"`
	Address   string     `yaml:"address"`
	TLSConfig *TLSStruct `yaml:"tls_config"`
}

ExporterConfig Exporterの設定

func (*ExporterConfig) ListenAddress

func (c *ExporterConfig) ListenAddress() string

ListenAddress Addressが空の場合はデフォルト値(defaults.CoreExporterAddr)を、そうでなければAddressを返す

type TLSStruct

type TLSStruct struct {
	TLSCertPath string `yaml:"cert_file"`
	TLSKeyPath  string `yaml:"key_file"`
	ClientAuth  string `yaml:"client_auth_type"`
	ClientCAs   string `yaml:"client_ca_file"` // NoClientCert | RequestClientCert | RequireAnyClientCert | VerifyClientCertIfGiven | RequireAndVerifyClientCert
	RootCAs     string `yaml:"root_ca_file"`
}

func (*TLSStruct) SetDirectory

func (t *TLSStruct) SetDirectory(dir string)

func (*TLSStruct) TLSConfig

func (t *TLSStruct) TLSConfig() (*tls.Config, error)

func (*TLSStruct) TransportCredentials

func (t *TLSStruct) TransportCredentials() (credentials.TransportCredentials, error)

Jump to

Keyboard shortcuts

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