config

package
v0.0.0-...-01b96be Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RateLimit RateLimit `mapstructure:",squash"`
	TLS       TLS       `mapstructure:",squash"`
	Tracing   Tracing   `mapstructure:",squash"`
	Metrics   Metrics   `mapstructure:",squash"`
	Logger    Logger    `mapstructure:",squash"`
	Docs      Docs      `mapstructure:",squash"`
	// HTTP and GRPC server timeout [default = 30s]
	Timeout *time.Duration `mapstructure:"TIMEOUT"`
	Network string         `mapstructure:"NETWORK"`
	Addr    string         `mapstructure:"ADDR"`
	Debug   bool           `mapstructure:"DEBUG"`
	Name    string         `mapstructure:"-"`
	Version string         `mapstructure:"-"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type Docs

type Docs struct {
	Disabled bool `mapstructure:"DOCS_DISABLED"`
}

type Logger

type Logger struct {
	Disabled bool `mapstructure:"LOGGER_DISABLED"`
}

type Metrics

type Metrics struct {
	Disabled bool `mapstructure:"METRICS_DISABLED"`
}

type RateLimit

type RateLimit struct {
	Disabled bool `mapstructure:"RATE_LIMIT_DISABLED"`
	// Window - defines time duration per window [default = 10s]
	Window *time.Duration `mapstructure:"RATE_LIMIT_WINDOW"`
	// Bucket - defines bucket number for each window [default = 100]
	Bucket *int32 `mapstructure:"RATE_LIMIT_BUCKET"`
	// CPUThreshold [default = 800]
	CPUThreshold *int64 `mapstructure:"RATE_LIMIT_CPU_THRESHOLD"`
}

type TLS

type TLS struct {
	Enabled bool `mapstructure:"TLS"`
	// Path to cert file
	Crt string `mapstructure:"TLS_CRT"`
	// Path to key file
	Key string `mapstructure:"TLS_KEY"`
}

type Tracing

type Tracing struct {
	Disabled bool `mapstructure:"TRACING_DISABLED"`
}

Jump to

Keyboard shortcuts

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