config

package
v0.0.0-...-cb1e3f4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name  string `mapstructure:"name"`
	Debug bool   `mapstructure:"debug"`
}

type CacheConfig

type CacheConfig struct {
	URL               string        `mapstructure:"url"`
	DB                int           `mapstructure:"db"`
	Prefix            string        `mapstructure:"prefix"`
	DefaultExpiration time.Duration `mapstructure:"default-expiration"`
}

type Config

type Config struct {
	App        AppConfig        `mapstructure:"app"`
	DB         DBConfig         `mapstructure:"db"`
	Cache      CacheConfig      `mapstructure:"cache"`
	Server     ServerConfig     `mapstructure:"server"`
	HTTPClient HTTPClientConfig `mapstructure:"http-client"`
}

func ReadConfig

func ReadConfig(env string) (Config, error)

type DBConfig

type DBConfig struct {
	URL string `mapstructure:"url"`
}

type HTTPClientConfig

type HTTPClientConfig struct {
	Timeout time.Duration `mapstructure:"timeout"`
}

type ServerAuthConfig

type ServerAuthConfig struct {
	ClientsURLs []string `mapstructure:"clients-urls"`
}

type ServerConfig

type ServerConfig struct {
	Port      int                   `mapstructure:"port"`
	Prefix    string                `mapstructure:"prefix"`
	Auth      ServerAuthConfig      `mapstructure:"auth"`
	RateLimit ServerRateLimitConfig `mapstructure:"rate-limit"`
	RouteKeys ServerRouteKeysConfig `mapstructure:"route-keys"`
}

type ServerRateLimitConfig

type ServerRateLimitConfig struct {
	Period time.Duration `mapstructure:"period"`
	Limit  int64         `mapstructure:"limit"`
}

type ServerRouteKeysConfig

type ServerRouteKeysConfig struct {
	UpdateTrophies string `mapstructure:"update-trophies"`
}

Jump to

Keyboard shortcuts

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