config

package
v0.0.0-...-beb47d6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BuildTime is a time label of the moment when the binary was built
	BuildTime string = "unset"
	// Commit is a last commit hash at the moment when the binary was built
	Commit = "unset"
	// Release is a semantic version of current build
	Release = "unset"
)

Functions

func GetEnv

func GetEnv(key string, defVal string) string

func GetEnvInt

func GetEnvInt(key string, defVal int64) int64

Types

type Config

type Config struct {
	//Db_url       string `yaml:"db_url" json:"db_url"`
	Port uint `yaml:"port" json:"port" `
}

Config - структура для считывания конфигурационного файла

func ReadConfig

func ReadConfig(ConfigName string) (x *Config, err error)

func (*Config) CheckUrl

func (e *Config) CheckUrl(path string) error

func (*Config) SetPort

func (e *Config) SetPort(p uint) error

func (*Config) Validate

func (e *Config) Validate() error

type Flag

type Flag struct {
	ConfigFile string
	Port       uint
	Port2      uint
	Host       string
	Db_url     string
}
var ConfigFlag Flag

type VersionType

type VersionType struct {
	Minor     string `json:"Minor"`
	Major     string `json:"Major"`
	Patch     string `json:"Patch"`
	Commit    string `json:"Commit"`
	BuildTime string `json:"BuildTime"`
}
var Version VersionType

func (*VersionType) ReadVersionFile

func (v *VersionType) ReadVersionFile(versionFile string) (err error)

func (*VersionType) VersionStr

func (v *VersionType) VersionStr() string

Jump to

Keyboard shortcuts

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