config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: MIT Imports: 6 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIsJSONTag added in v1.1.0

func GetIsJSONTag() bool

GetIsJSONTag json标记

func GetMysqlConStr

func GetMysqlConStr() string

GetMysqlConStr 获取mysql 连接字符串

func GetOutDir

func GetOutDir() string

GetOutDir 获取输出目录

func GetServiceConfig added in v1.1.0

func GetServiceConfig() (name, displayName, desc string)

GetServiceConfig 获取service配置信息

func GetSimple

func GetSimple() bool

GetSimple 简单输出

func GetSingularTable

func GetSingularTable() bool

GetSingularTable 获取禁用表名复数

func InitFile

func InitFile(filename string) error

InitFile ...

func IsRunTesting

func IsRunTesting() bool

IsRunTesting 判断是否在测试环境下使用

func SetMysqlDbInfo

func SetMysqlDbInfo(info *MysqlDbInfo)

SetMysqlDbInfo 更新mysql配置信息

func SetOutDir

func SetOutDir(outDir string)

SetOutDir 设置输出目录

func SetSingularTable

func SetSingularTable(b bool)

SetSingularTable 设置禁用表名复数

Types

type CfgBase

type CfgBase struct {
	SerialNumber       string `json:"serial_number" toml:"serial_number"`             //版本号
	ServiceName        string `json:"service_name" toml:"service_name"`               //service名字
	ServiceDisplayname string `json:"service_displayname" toml:"service_displayname"` //显示名
	SerciceDesc        string `json:"sercice_desc" toml:"sercice_desc"`               //service描述
	IsDev              bool   `json:"is_dev" toml:"is_dev"`                           //是否是开发版本
}

CfgBase .

type Config

type Config struct {
	CfgBase
	MySQLInfo     MysqlDbInfo `toml:"mysql_info"`
	OutDir        string      `toml:"out_dir"`
	Simple        bool        `toml:"simple"`
	IsJSONTag     bool        `toml:"isJsonTag"`
	SingularTable bool        `toml:"singular_table"`
}

Config .

type MysqlDbInfo

type MysqlDbInfo struct {
	Host     string `validate:"required"` //地址
	Port     int    `validate:"required"` //端口号
	Username string `validate:"required"` //用户名
	Password string `validate:"required"` //密码
	Database string `validate:"required"` //数据库名
}

MysqlDbInfo mysql 数据库信息

func GetMysqlDbInfo

func GetMysqlDbInfo() MysqlDbInfo

GetMysqlDbInfo 获取mysql配置信息

Jump to

Keyboard shortcuts

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