config

package
v0.0.0-...-f5a8ae6 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 5 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 {
	StartUpDelay int `yaml:"startup_delay" env:"GOSHORTRR_STARTUP_DELAY"`
	MySQL        struct {
		Host     string `yaml:"host" env:"GOSHORTRR_MYSQL_HOST,notEmpty"`
		Port     int    `yaml:"port" env:"GOSHORTRR_MYSQL_PORT,notEmpty"`
		User     string `yaml:"user" env:"GOSHORTRR_MYSQL_USER,notEmpty"`
		Password string `yaml:"password" env:"GOSHORTRR_MYSQL_PASSWORD,notEmpty"`
		DB       string `yaml:"db" env:"GOSHORTRR_MYSQL_DB,notEmpty"`
	} `yaml:"mysql"`

	WebServer struct {
		AddressAndPort string `yaml:"address_and_port" env:"GOSHORTRR_ADDRESS_AND_PORT,notEmpty"`
		APIAccessToken string `yaml:"api_access_token" env:"GOSHORTRR_API_ACCESS_TOKEN"`
	} `yaml:"webserver"`
}

Holds data of parsed config

func ParseConfig

func ParseConfig(path string) (*Config, error)

Parses the config file

Jump to

Keyboard shortcuts

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