config

package
v0.0.0-...-7f08f7b Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigPath = "etc/"
	BaseConfig = "base.ini"

	ProductionEnv = "production"
	DevEnv        = "dev"
	DefaultEnv    = DevEnv
)

Variables

View Source
var (
	AllowedEnvs = []string{ProductionEnv, DevEnv}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	DB     `ini:"DEFAULT"`
	Deploy `ini:"DEFAULT"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Init

func (this *Config) Init() error

type DB

type DB struct {
	Addr   string `ini:"db_addr"`
	Name   string `ini:"db_name"`
	User   string `ini:"db_user"`
	Passwd string `ini:"db_passwd"`
}

type Deploy

type Deploy struct {
	Env  string `ini:"env"`
	Port string `ini:"port"`
}

type EnvConfig

type EnvConfig struct {
	Deploy
	DB
}

func ReadEnvConfig

func ReadEnvConfig() EnvConfig

Jump to

Keyboard shortcuts

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