configuration

package
v0.0.0-...-becdb2d Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package configuration is a small package for handling configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Backend                  string `mapstructure:"backend"         desc:"destination host"                                     default:"http://127.0.0.1"`
	ClientCAPoolPath         string `mapstructure:"clients-ca"      desc:"Path the CAs used to verify client certificates"      required:"true"`
	ListenAddress            string `mapstructure:"listen"          desc:"Listening address"                                    default:":443"`
	ServerCertificateKeyPass string `mapstructure:"cert-key-pass"   desc:"Password for the server certificate key"              `
	ServerCertificateKeyPath string `mapstructure:"cert-key"        desc:"Path to the server certificate key"                   required:"true"`
	ServerCertificatePath    string `mapstructure:"cert"            desc:"Path to the server certificate"                       required:"true"`
	Mode                     string `mapstructure:"mode"            desc:"Proxy mode"                                           default:"http" allowed:"tcp,http"`
	LogFormat                string `mapstructure:"log-format"      desc:"Log format"                                           default:"console"`
	LogLevel                 string `mapstructure:"log-level"       desc:"Log level"                                            default:"info"`

	ClientCAPool       *x509.CertPool
	ServerCertificates []tls.Certificate
}

Configuration hold the service configuration.

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new configuration.

func (*Configuration) Prefix

func (c *Configuration) Prefix() string

Prefix returns the configuration prefix.

func (*Configuration) PrintVersion

func (c *Configuration) PrintVersion()

PrintVersion prints the current version.

Jump to

Keyboard shortcuts

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