config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileNotFound = errors.New("file config.yml was not found")

ErrFileNotFound is returned if the file was not found.

View Source
var ErrInvalidYamlFile = errors.New("file config.yaml has invalid content")

ErrInvalidYamlFile is return when the file does not satisfy the yaml file type.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port     int       `yaml:"Port"`
	DBConfig *DBConfig `yaml:"DB"`
}

Config defines a configuration for the web API.

func GetConfig

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

GetConfig tries to load and handle the configuration file.

type DBConfig

type DBConfig struct {
	Host     string `yaml:"Host"`
	Port     int    `yaml:"Port"`
	User     string `yaml:"User"`
	Password string `yaml:"Password"`
	DBname   string `yaml:"Database_Name"`
}

DBConfig holds database connection's credentials.

Jump to

Keyboard shortcuts

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