config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewValidationError

func NewValidationError(message string) error

Types

type Config

type Config struct {
	Proxy  ProxyConfig  `mapstructure:"proxy"`
	Server ServerConfig `mapstructure:"server"`
	Log    LogConfig    `mapstructure:"log"`
}

func LoadConfig

func LoadConfig(configFilePath string, overrides []string) (*Config, error)

type HeadersConfig

type HeadersConfig struct {
	IncludeDigest        bool     `mapstructure:"includeDigest"`
	IncludeRequestTarget bool     `mapstructure:"includeRequestTarget"`
	SignatureHeaders     []string `mapstructure:"signatureHeaders"`
}

type KV

type KV map[string]interface{}

type LogConfig

type LogConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

type ProxyConfig

type ProxyConfig struct {
	UpstreamTarget string       `mapstructure:"upstreamTarget"`
	Signer         SignerConfig `mapstructure:"signer"`
}

type SSLConfig

type SSLConfig struct {
	Enable       bool   `mapstructure:"enable"`
	CertFilePath string `mapstructure:"certFilePath"`
	KeyFilePath  string `mapstructure:"keyFilePath"`
}

type ServerConfig

type ServerConfig struct {
	Port                     int       `mapstructure:"port"`
	SSL                      SSLConfig `mapstructure:"ssl"`
	AccessControlAllowOrigin string    `mapstructure:"accessControlAllowOrigin"`
}

type SignerConfig

type SignerConfig struct {
	KeyId             string        `mapstructure:"keyId"`
	KeyFilePath       string        `mapstructure:"keyFilePath"`
	BodyDigestAlgo    string        `mapstructure:"bodyDigestAlgo"`
	SignatureHashAlgo string        `mapstructure:"signatureHashAlgo"`
	Headers           HeadersConfig `mapstructure:"headers"`
}

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

ValidationError describes an error validating the provided config.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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