config

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(cfg string, data interface{})

LoadConfig reads in config file and ENV variables if set.

Types

type Config

type Config struct {
	Version      string           `mapstructure:"version" json:"version" yaml:"version"`
	RootPackage  string           `mapstructure:"rootPackage" json:"rootPackage" yaml:"rootPackage"`
	Directory    Directory        `mapstructure:"directory" json:"directory" yaml:"directory"`
	MysqlOptions *db.MySQLOptions `mapstructure:"mysql" json:"mysql" yaml:"mysql"`

	Registries Registries `mapstructure:"registries" json:"registries" yaml:"registries"`
}
var (
	Cfg *Config
	DB  *gorm.DB
)

func NewDefaultConfig

func NewDefaultConfig() *Config

type Directory

type Directory struct {
	CMD        string `mapstructure:"cmd" json:"cmd" yaml:"cmd"`
	Model      string `mapstructure:"model" json:"model" yaml:"model"`
	Store      string `mapstructure:"store" json:"store" yaml:"store"`
	Request    string `mapstructure:"request" json:"request" yaml:"request"`
	Biz        string `mapstructure:"biz" json:"biz" yaml:"biz"`
	Controller string `mapstructure:"controller" json:"controller" yaml:"controller"`
	Middleware string `mapstructure:"middleware" json:"middleware" yaml:"middleware"`
	Job        string `mapstructure:"job" json:"job" yaml:"job"`
	Migration  string `mapstructure:"migration" json:"migration" yaml:"migration"`
	Seeder     string `mapstructure:"seeder" json:"seeder" yaml:"seeder"`
}

type Registries added in v0.1.7

type Registries struct {
	Router string   `mapstructure:"router" json:"router" yaml:"router"`
	Store  Registry `mapstructure:"store" json:"store" yaml:"store"`
	Biz    Registry `mapstructure:"biz" json:"biz" yaml:"biz"`
}

type Registry added in v0.1.7

type Registry struct {
	Filepath  string `mapstructure:"filepath" json:"filepath" yaml:"filepath"`
	Interface string `mapstructure:"interface" json:"interface" yaml:"interface"`
}

Jump to

Keyboard shortcuts

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