configs

package
v0.0.0-...-ba4ce30 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 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 {
	ServerConfig ServerConfig   `mapstructure:"app"`
	DBConfig     DatabaseConfig `mapstructure:"db"`
	ClientConfig ClientConfig   `mapstructure:"client"`
}

func LoadConfig

func LoadConfig(reader io.Reader) (*AppConfig, error)

func ProvideAppConfig

func ProvideAppConfig() (c *AppConfig, err error)

type ClientConfig

type ClientConfig struct {
	ClientName    string `mapstructure:"clientName"`
	LogLevel      string `mapstructure:"logLevel"`
	ServerAddress string `mapstructure:"serverAddress"`
}

type ConnectionPool

type ConnectionPool struct {
	MaxOpenConnections int `mapstructure:"maxOpenConnections"`
	MaxIdleConnections int `mapstructure:"maxIdleConnections"`
	MaxIdleTime        int `mapstructure:"maxIdleTime"`
	MaxLifeTime        int `mapstructure:"maxLifeTime"`
	TimeOut            int `mapstructure:"timeout"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Dbname        string         `mapstructure:"name"`
	Schema        string         `mapstructure:"schema"`
	Username      string         `mapstructure:"user"`
	Password      string         `mapstructure:"password"`
	Host          string         `mapstructure:"host"`
	Port          int            `mapstructure:"port"`
	LogMode       bool           `mapstructure:"logMode"`
	SslMode       string         `mapstructure:"sslMode"`
	Connection    ConnectionPool `mapstructure:"connectionPool"`
	MigrationPath string         `mapstructure:"migrationPath"`
}

type ServerConfig

type ServerConfig struct {
	ServiceName string `mapstructure:"serviceName"`
	Host        string `mapstructure:"host"`
	Port        int    `mapstructure:"port"`
	LogLevel    string `mapstructure:"logLevel"`

	ReviewServerAddress   string `mapstructure:"reviewServerAddress"`
	BookServerAddress     string `mapstructure:"bookServerAddress"`
	BookInfoServerAddress string `mapstructure:"bookInfoServerAddress"`
}

Jump to

Keyboard shortcuts

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