config

package
v0.0.0-...-d6e0c60 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 8 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 {
	Mode     string `mapstructure:"mode"`
	Dotenv   string `mapstructure:"dotenv"`
	Handlers struct {
		ExternalAPI struct {
			Port      string `mapstrucutre:"port"`
			CertFile  string `mapstructure:"certFile"`
			KeyFile   string `mapstructure:"keyFile"`
			EnableTLS bool   `mapstracture:"enableTLS"`
		} `mapstructure:"externalAPI"`
		Pprof struct {
			Port      string `mapstructure:"port"`
			CertFile  string `mapstructure:"certFile"`
			KeyFile   string `mapstructure:"keyFile"`
			EnableTLS bool   `mapstructure:"enableTLS"`
		}
		Prometheus struct {
			Port      string `mapstructure:"port"`
			CertFile  string `mapstructure:"certFile"`
			KeyFile   string `mapstructure:"keyFile"`
			EnableTLS bool   `mapstructure:"enableTLS"`
		}
	} `mapstructure:"handlers"`
	Repositories struct {
		Postgres struct {
			Host              string `mapstructure:"host"`
			Password          string `mapstructure:"password"`
			Port              string `mapstructure:"port"`
			Username          string `mapstructure:"username"`
			DB                string `mapstructure:"db"`
			SSLMODE           string `mapstructure:"SSLMODE"`
			MAXCONWAITINGTIME int    `mapstructure:"MAXCONWAITINGTIME"`
		}
		Redis struct {
			Host string        `mapstructure:"host"`
			Port string        `mapstructure:"port"`
			Pass string        `mapstructure:"pass"`
			DB   int           `mapstructure:"db"`
			TTL  time.Duration `mapstructure:"ttl"`
		}
	}
	Server struct {
		HTTPPort       string        `mapstructure:"HTTPPort"`
		GrpcPort       string        `mapstructure:"GRPCPort"`
		Timeout        time.Duration `mapstructure:"HTTPTimeout"`
		CustomerBroker *customer.Broker
	} `mapstructure:"server"`
	UpstreamServices struct {
		Customer    string `mapstructure:"customer"`
		Auth        string `mapstructure:"auth"`
		Calculator  string `mapstructure:"calculator"`
		Activity    string `mapstructure:"activity"`
		Workout     string `mapstructure:"workout"`
		Measurement string `mapstructure:"measurement"`
		Ingredients string `mapstructure:"ingredients"`
		Meals       string `mapstructure:"meals"`
	} `mapstructure:"upstreamServices"`
}

func InitConfig

func InitConfig() (Config, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳