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, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Path = "config/config.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Authn

type Authn struct {
	Enabled bool     `mapstructure:"enabled"`
	Keys    []string `mapstructure:"keys"`
}

Authn -.

type Config

type Config struct {
	Server   `mapstructure:"server"`
	Log      `mapstructure:"logger"`
	Profiler `mapstructure:"profiler"`
	Authn    `mapstructure:"authn"`
	Tracer   `mapstructure:"tracer"`
	Meter    `mapstructure:"meter"`
	Service  `mapstructure:"service"`
	Database `mapstructure:"database"`
}

Config -

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig - Creates default config.

func NewConfig

func NewConfig() (*Config, error)

NewConfig - Creates new config

type Database

type Database struct {
	Engine                string        `mapstructure:"engine"`
	URI                   string        `mapstructure:"uri"`
	AutoMigrate           bool          `mapstructure:"auto_migrate"`
	MaxOpenConnections    int           `mapstructure:"max_open_connections"`
	MaxIdleConnections    int           `mapstructure:"max_idle_connections"`
	MaxConnectionLifetime time.Duration `mapstructure:"max_connection_lifetime"`
	MaxConnectionIdleTime time.Duration `mapstructure:"max_connection_idle_time"`
}

Database -.

type GRPC

type GRPC struct {
	Port      string    `mapstructure:"port"`
	TLSConfig TLSConfig `mapstructure:"tls"`
}

type HTTP

type HTTP struct {
	Enabled            bool      `mapstructure:"enabled"`
	Port               string    `mapstructure:"port"`
	TLSConfig          TLSConfig `mapstructure:"tls"`
	CORSAllowedOrigins []string  `mapstructure:"cors_allowed_origins"`
	CORSAllowedHeaders []string  `mapstructure:"cors_allowed_headers"`
}

HTTP -.

type Log

type Log struct {
	Level string `mapstructure:"level"`
}

Log -.

type Meter added in v0.2.1

type Meter struct {
	Enabled  bool   `mapstructure:"enabled"`
	Exporter string `mapstructure:"exporter"`
	Endpoint string `mapstructure:"endpoint"`
}

Meter -.

type Profiler added in v0.3.0

type Profiler struct {
	Enabled bool   `mapstructure:"enabled"`
	Port    string `mapstructure:"port"`
}

Profiler -.

type Server

type Server struct {
	HTTP `mapstructure:"http"`
	GRPC `mapstructure:"grpc"`
}

type Service

type Service struct {
	CircuitBreaker   bool `mapstructure:"circuit_breaker"`
	ConcurrencyLimit int  `mapstructure:"concurrency_limit"`
}

Service -.

type TLSConfig

type TLSConfig struct {
	Enabled  bool   `mapstructure:"enabled"`
	CertPath string `mapstructure:"cert_path"`
	KeyPath  string `mapstructure:"key_path"`
}

type Tracer

type Tracer struct {
	Enabled  bool   `mapstructure:"enabled"`
	Exporter string `mapstructure:"exporter"`
	Endpoint string `mapstructure:"endpoint"`
}

Tracer -.

Jump to

Keyboard shortcuts

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