package
Version:
v2.1.24
Opens a new window with list of versions in this module.
Published: Aug 23, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
View Source
const (
PROJECT_NAME = "gocore"
PROJECT_VERSION = "v2.0.1"
)
配置常量
type Api struct {
Prefix string `yaml:"prefix"`
ModuleName string `yaml:"moduleName"`
Handle []Handle `yaml:"handle"`
}
type Config struct {
CNacos bool `yaml:"cNacos"`
CRocketMQConfig bool `yaml:"cRocketMQConfig"`
CMysql []Mysql `yaml:"cMysql"`
CRedis []Redis `yaml:"cRedis"`
}
type GoCore struct {
Service Service `yaml:"service"`
Config Config `yaml:"config"`
HttpApiEnable bool `yaml:"httpApiEnable"`
RPCEnable bool `yaml:"rpcEnable"`
JobEnable bool `yaml:"jobEnable"`
HttpApis HttpApi `yaml:"httpApis"`
Jobs []Job `yaml:"jobs"`
}
func GetGocoreConfig() *GoCore
type Handle ¶
added in
v2.0.2
type Handle struct {
Name string `yaml:"name"`
Method string `yaml:"method"`
RequestParams []Param `yaml:"requestParams"`
ResponseParams []Param `yaml:"responseParams"`
Comment string `yaml:"comment"`
}
type HttpApi struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
Apis []Api `yaml:"apis"`
Params map[string][]Param `yaml:"params"`
}
HttpApi 路由拼接规则 /public/v1/项目名/模块名/接口名
TODO: swagger.json导入
type Job struct {
Name string `yaml:"name"`
}
type Model struct {
Name string `yaml:"name"`
Auto bool `yaml:"auto"`
Fields []string `yaml:"fields"`
}
type Mysql struct {
Name string `yaml:"name"`
HotUpdate bool `yaml:"hotUpdate"`
Models []Model `yaml:"models"`
}
type MysqlDb struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
User string `yaml:"user"`
Password string `yaml:"password"`
Database string `yaml:"database"`
Tables []string `yaml:"tables"`
}
type Param struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Validate string `yaml:"validate"`
}
type Redis struct {
Name string `yaml:"name"`
HotUpdate bool `yaml:"hotUpdate"`
Index map[string]int `yaml:"index"`
}
type Service struct {
ProjectName string `yaml:"projectName"`
Version string `yaml:"version"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.