config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 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 {
	MySQL struct {
		Host     string `yaml:"host" env:"SHORTINATOR_MYSQL_HOST,notEmpty"`
		Port     int    `yaml:"port" env:"SHORTINATOR_MYSQL_PORT,notEmpty"`
		User     string `yaml:"user" env:"SHORTINATOR_MYSQL_USER,notEmpty"`
		Password string `yaml:"password" env:"SHORTINATOR_MYSQL_PASSWORD,notEmpty"`
		DB       string `yaml:"db" env:"SHORTINATOR_MYSQL_DB,notEmpty"`
	} `yaml:"mysql"`

	WebServer struct {
		AddressAndPort string `yaml:"address_and_port" env:"SHORTINATOR_ADDRESS_AND_PORT,notEmpty"`
		APIAccessToken string `yaml:"api_access_token" env:"SHORTINATOR_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