config

package
v0.0.0-...-3eb4ebe Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigByKey

func GetConfigByKey(key string, config interface{}) error

GetConfigByKey gets config to given struct by key

Types

type AccountServiceConfigurations

type AccountServiceConfigurations struct {
	DBUser       string `mapstructure:"db_user"`
	DBPass       string `mapstructure:"db_pass"`
	DBHost       string `mapstructure:"db_host"`
	DBPort       int    `mapstructure:"db_port"`
	DBName       string `mapstructure:"db_name"`
	DSN          string `mapstructure:"db_dsn"`
	MaxOpenConns int    `mapstructure:"db_max_open_conns"`
	MaxIdleConns int    `mapstructure:"db_max_idle_conns"`
	MaxIdleTime  string `mapstructure:"db_max_idle_time"`
	SSLMode      string `mapstructure:"db_ssl_mode"`
	RedisUrl     string `mapstructure:"redis_url"`
	RedisPass    string `mapstructure:"redis_pass"`
	GRPCPort     string `mapstructure:"grpc_port"`
	GRPCHost     string `mapstructure:"grpc_host"`
}

type CalendarServiceConfigurations

type CalendarServiceConfigurations struct {
	DBUser       string `mapstructure:"db_user"`
	DBPass       string `mapstructure:"db_pass"`
	DBPort       int    `mapstructure:"db_port"`
	DBName       string `mapstructure:"db_name"`
	URI          string `mapstructure:"db_uri"`
	MaxOpenConns int    `mapstructure:"db_max_open_conns"`
	MaxIdleConns int    `mapstructure:"db_max_idle_conns"`
	MaxIdleTime  string `mapstructure:"db_max_idle_time"`
	SSLMode      string `mapstructure:"db_ssl_mode"`
	GRPCPort     string `mapstructure:"grpc_port"`
	GRPCHost     string `mapstructure:"grpc_host"`
}

type Config

type Config struct {
	Calendar CalendarServiceConfigurations `mapstructure:"calendar_service"`
	Account  AccountServiceConfigurations  `mapstructure:"account_service"`
	WebApi   WebApiServiceConfigurations   `mapstructure:"web_api_service"`
}

type WebApiServiceConfigurations

type WebApiServiceConfigurations struct {
	CalendarServicePort string `mapstructure:"calendar_service_port"`
	CalendarServiceHost string `mapstructure:"calendar_service_host"`
	AccountServicePort  string `mapstructure:"account_service_port"`
	AccountServiceHost  string `mapstructure:"account_service_host"`
	HTTPPort            string `mapstructure:"http_port"`
	HTTPHost            string `mapstructure:"http_host"`
}

Jump to

Keyboard shortcuts

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