config

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMigrateTable = "bingo_migration"

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"`

	Migrate MigrateConfig `mapstructure:"migrate" json:"migrate" yaml:"migrate"`
}
var (
	Cfg *Config
	DB  *gorm.DB
)

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) GetMigrateTable added in v1.5.2

func (c *Config) GetMigrateTable() string

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"`
	Handler    string `mapstructure:"handler" json:"handler" yaml:"handler"`
	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 MigrateConfig added in v1.5.2

type MigrateConfig struct {
	Table string `mapstructure:"table" json:"table" yaml:"table"`
}

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