config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvConfPath

func GetEnvConfPath() string

GetEnvConfPath returns toml file path from environment variable `$GO_GOOGLE_HOME_CONF`

Types

type Device

type Device struct {
	Address string `toml:"address"`
	Lang    string `toml:"lang"`
	Timeout string `toml:"timeout" validate:"required"`
}

Device is device property

type Logger

type Logger struct {
	Service      string `toml:"service" validate:"required"`
	Env          string `toml:"env" validate:"oneof=dev prod custom"`
	Level        string `toml:"level" validate:"required"`
	IsStackTrace bool   `toml:"is_stacktrace"`
}

Logger is zap logger property

type Root

type Root struct {
	Device *Device `toml:"device" validate:"required"`
	Logger *Logger `toml:"logger" validate:"required"`
	Server *Server `toml:"server"`
}

Root is root config

func NewConfig

func NewConfig(fileName string) (*Root, error)

NewConfig returns *Root config

type Server

type Server struct {
	Port int `toml:"port"`
}

Server is server property

Jump to

Keyboard shortcuts

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