config

package
v0.0.0-...-b9cf7ac Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: MIT Imports: 7 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 {
	Env       string `yaml:"env" envconfig:"env"`
	DebugMode bool   `yaml:"debug"`
	Name      string `yaml:"name"`
}

func (AppConfig) IsLocal

func (appConfig AppConfig) IsLocal() bool

IsLocal returns ok if app is configured to run in local mode.

func (AppConfig) IsProd

func (appConfig AppConfig) IsProd() bool

IsProd returns ok if app is configured to run in prod mode.

type Configs

type Configs struct {
	fx.Out
	AppConfig   *AppConfig        `yaml:"app"`
	HTTPConfig  *HTTPConfig       `yaml:"http"`
	RedisConfig *RedisConfig      `yaml:"redis"`
	GRPCClients GRPCClientsConfig `yaml:"grpcClients"`
}

Configs holds all the configs.

func SetupConfigs

func SetupConfigs() (Configs, error)

SetupConfigs fills Configs with data from files and envs.

type GRPCClientConfig

type GRPCClientConfig struct {
	Addr       string `yaml:"addr"`
	TimeoutSec string `yaml:"timeoutSec"`
}

type GRPCClientsConfig

type GRPCClientsConfig struct {
	fx.Out
	UserService UserServiceConfig `yaml:"userservice"`
}

type HTTPConfig

type HTTPConfig struct {
	Port int `yaml:"port"`
}

HTTPConfig holds config for the HTTP server.

type RedisConfig

type RedisConfig struct {
	Host  string `yaml:"host"`
	Port  int    `yaml:"port"`
	Token string `yaml:"token"`
	DB    string `yaml:"db"`
}

RedisConfig holds a DB config.

type UserServiceConfig

type UserServiceConfig GRPCClientConfig

Jump to

Keyboard shortcuts

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