config

package
v0.0.0-...-d6f249d Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDBTag

func GetDBTag() string

GetDBTag get database tag.

func GetIsDev

func GetIsDev() bool

GetIsDev is is dev

func GetIsForeignKey

func GetIsForeignKey() bool

GetIsForeignKey if is foreign key

func GetIsGUI

func GetIsGUI() bool

GetIsGUI if is gui show .

func GetIsNullToPoint

func GetIsNullToPoint() bool

GetIsNullToPoint get if with null to porint in sturct

func GetIsOutFunc

func GetIsOutFunc() bool

GetIsOutFunc if is output func .

func GetIsOutSQL

func GetIsOutSQL() bool

GetIsOutSQL if is output sql .

func GetIsTableName

func GetIsTableName() bool

GetIsTableName if is table name .

func GetIsWEBTag

func GetIsWEBTag() bool

GetIsWEBTag json tag.json标记

func GetIsWebTagPkHidden

func GetIsWebTagPkHidden() bool

GetIsWebTagPkHidden web tag是否隐藏主键

func GetLG

func GetLG() string

GetLG get language tag.

func GetMysqlConStr

func GetMysqlConStr() string

GetMysqlConStr Get MySQL connection string.获取mysql 连接字符串

func GetOutDir

func GetOutDir() string

GetOutDir Get Output Directory.获取输出目录

func GetSimple

func GetSimple() bool

GetSimple simple output.简单输出

func GetSingularTable

func GetSingularTable() bool

GetSingularTable Get Disabled Table Name Plurals.获取禁用表名复数

func GetURLTag

func GetURLTag() string

GetURLTag get url tag.

func InitFile

func InitFile(filename string) error

InitFile default value from file .

func IsRunTesting

func IsRunTesting() bool

IsRunTesting Determine whether to use it in a test environment.判断是否在测试环境下使用

func SaveToFile

func SaveToFile() error

SaveToFile save config info to file

func SetDBTag

func SetDBTag(s string)

SetDBTag get database tag.

func SetForeignKey

func SetForeignKey(b bool)

SetForeignKey Set if is foreign key.设置是否外键关联

func SetIsDev

func SetIsDev(b bool)

SetIsDev is is dev

func SetIsGUI

func SetIsGUI(b bool)

SetIsGUI if is gui show .

func SetIsNullToPoint

func SetIsNullToPoint(b bool)

SetIsNullToPoint if with null to porint in struct

func SetIsOutFunc

func SetIsOutFunc(b bool)

SetIsOutFunc if is output func .

func SetIsOutSQL

func SetIsOutSQL(b bool)

SetIsOutSQL if is output sql .

func SetIsTableName

func SetIsTableName(b bool)

SetIsTableName if is table name .

func SetLG

func SetLG(s string)

SetLG set url tag.

func SetMysqlDbInfo

func SetMysqlDbInfo(info *DBInfo)

SetMysqlDbInfo Update MySQL configuration information

func SetOutDir

func SetOutDir(outDir string)

SetOutDir Setting Output Directory.设置输出目录

func SetSimple

func SetSimple(b bool)

SetSimple simple output.简单输出

func SetSingularTable

func SetSingularTable(b bool)

SetSingularTable Set Disabled Table Name Plurals.设置禁用表名复数

func SetURLTag

func SetURLTag(s string)

SetURLTag set url tag.

Types

type CfgBase

type CfgBase struct {
	// SerialNumber       string `json:"serial_number" yaml:"serial_number"`             // version.版本号
	// ServiceName        string `json:"service_name" yaml:"service_name"`               // service name .service名字
	// ServiceDisplayname string `json:"service_displayname" yaml:"service_displayname"` // display name .显示名
	// SerciceDesc        string `json:"sercice_desc" yaml:"sercice_desc"`               // sercice desc .service描述
	IsDev bool `json:"is_dev" yaml:"is_dev"` // Is it a development version?是否是开发版本
}

CfgBase base config struct

type Config

type Config struct {
	CfgBase          `yaml:"base"`
	DBInfo           DBInfo `yaml:"db_info"`
	OutDir           string `yaml:"out_dir"`
	URLTag           string `yaml:"url_tag"`  // url tag
	Language         string `yaml:"language"` // language
	DbTag            string `yaml:"db_tag"`   // 数据库标签(gormt,db)
	Simple           bool   `yaml:"simple"`
	IsWEBTag         bool   `yaml:"is_web_tag"`
	IsWebTagPkHidden bool   `yaml:"is_web_tag_pk_hidden"` // web标记是否隐藏主键
	SingularTable    bool   `yaml:"singular_table"`
	IsForeignKey     bool   `yaml:"is_foreign_key"`
	IsOutSQL         bool   `yaml:"is_out_sql"`
	IsOutFunc        bool   `yaml:"is_out_func"`
	IsGUI            bool   `yaml:"is_gui"` //
	IsTableName      bool   `yaml:"is_table_name"`
	IsNullToPoint    bool   `yaml:"is_null_to_point"` // null to porint
}

Config custom config struct

type DBInfo

type DBInfo struct {
	Host     string `validate:"required"` // Host. 地址
	Port     int    // Port 端口号
	Username string // Username 用户名
	Password string // Password 密码
	Database string // Database 数据库名
	Type     int    // 数据库类型:0:mysql 1:配置
}

DBInfo mysql database information. mysql 数据库信息

func GetDbInfo

func GetDbInfo() DBInfo

GetDbInfo Get configuration information .获取数据配置信息

Jump to

Keyboard shortcuts

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