config

package
v0.0.0-...-5ce893b Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 6 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 {
	DebugMode bool   `yaml:"debug"`
	Name      string `yaml:"name"`
}

type Configs

type Configs struct {
	fx.Out
	AppConfig      *AppConfig      `yaml:"app"`
	HTTPConfig     *HTTPConfig     `yaml:"http"`
	GRPCConfig     *GRPCConfig     `yaml:"grpc"`
	PostgresConfig *PostgresConfig `yaml:"postgres"`
}

func SetupConfigs

func SetupConfigs() (Configs, error)

type GRPCConfig

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

type HTTPConfig

type HTTPConfig struct {
	Port            int    `yaml:"port"`
	HealthEndpoint  string `yaml:"healthEndpoint"`
	ReadyEndpoint   string `yaml:"readyEndpoint"`
	LiveEndpoint    string `yaml:"liveEndpoint"`
	MetricsEndpoint string `yaml:"metricsEndpoint"`
}

type PostgresConfig

type PostgresConfig struct {
	Host                     string `yaml:"host"`
	Port                     uint16 `yaml:"port"`
	DBName                   string `yaml:"dbname"`
	User                     string `yaml:"user"`
	Password                 string `yaml:"password"`
	MaxConnections           int32  `yaml:"maxConnections"`
	MinConnections           int32  `yaml:"minConnections"`
	HealthCheckPeriodMinutes int    `yaml:"healthCheckPeriodMinutes"`
	SSLMode                  string `yaml:"ssl_mode"`
}

PostgresConfig holds a DB config

func (*PostgresConfig) URL

func (cfg *PostgresConfig) URL() string

Jump to

Keyboard shortcuts

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