config

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtensionJson = ".json"
	ExtensionYaml = ".yaml"
	ExtensionInI  = ".ini"

	NameSpace = "conf"
)
View Source
const (
	EnvTesting    = Environment("testing")
	EnvProduction = Environment("production")
)

use export ENVIRONMENT=testing set global environment

Variables

This section is empty.

Functions

func GetConfigModels

func GetConfigModels() *models.Config

func LoadConfig

func LoadConfig(env, serverName, configFileName string) (*models.Config, error)

Types

type Environment

type Environment string

func NewGlobalEnvironment

func NewGlobalEnvironment() (Environment, error)

NewGlobalEnvironment 读取系统全局配置的环境变量

func (Environment) Invalid

func (env Environment) Invalid() bool

func (*Environment) Production

func (env *Environment) Production() Environment

func (*Environment) String

func (env *Environment) String() string

func (*Environment) Testing

func (env *Environment) Testing() Environment

Jump to

Keyboard shortcuts

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