config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 3 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 {
	Database DatabaseConfig
	Server   ServerConfig
}

func LoadConfig

func LoadConfig(env string) (Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Name     string `mapstructure:"name"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
}

type ServerConfig

type ServerConfig struct {
	Name         string        `mapstructure:"name"`
	Version      string        `mapstructure:"version"`
	RPCPort      string        `mapstructure:"rpc_port"`
	RESTPort     string        `mapstructure:"rest_port"`
	Debug        bool          `mapstructure:"debug"`
	Environment  string        `mapstructure:"env"`
	ReadTimeout  time.Duration `mapstructure:"read_time_out"`
	WriteTimeout time.Duration `mapstructure:"write_time_out"`
}

Jump to

Keyboard shortcuts

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