metrics

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PortDefault    = 2112
	AddressDefault = "0.0.0.0"

	TLSRootDir = "/etc/secrets/rte"

	TLSCert = "tls.crt"
	TLSKey  = "tls.key"
)
View Source
const (
	ServingDefault  = ServingDisabled
	ServingDisabled = "disabled"
	ServingHTTP     = "http" // plaintext
	ServingHTTPTLS  = "httptls"
)

Variables

This section is empty.

Functions

func AddressFromEnv added in v0.19.0

func AddressFromEnv() string

func PortFromEnv added in v0.17.0

func PortFromEnv() int

func ServingModeIsSupported

func ServingModeIsSupported(value string) (string, error)

func ServingModeSupported

func ServingModeSupported() string

func Setup

func Setup(mode string, conf Config) error

func WithClientAuth added in v0.18.1

func WithClientAuth(cliAuth bool) func(tlscfg *tls.Config)

Types

type Config

type Config struct {
	IP   string
	Port int
	TLS  TLSConfig
}

func NewConfig added in v0.17.0

func NewConfig(ip string, port int, tlsConf TLSConfig) Config

func NewDefaultConfig

func NewDefaultConfig() Config

func (Config) BindAddress added in v0.17.1

func (conf Config) BindAddress() string

func (Config) Validate

func (conf Config) Validate() error

type TLSConfig added in v0.17.0

type TLSConfig struct {
	CertsDir    string `json:"certsDir,omitempty"`
	CertFile    string `json:"certFile,omitempty"`
	KeyFile     string `json:"keyFile,omitempty"`
	WantCliAuth bool   `json:"wantCliAuth,omitempty"`
}

func NewDefaultTLSConfig added in v0.17.0

func NewDefaultTLSConfig() TLSConfig

func (TLSConfig) Clone added in v0.17.0

func (conf TLSConfig) Clone() TLSConfig

Jump to

Keyboard shortcuts

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