conf

package
v2.1.41 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROJECT_NAME    = "gocore"
	PROJECT_VERSION = "v2.0.1"
)

配置常量

Variables

This section is empty.

Functions

This section is empty.

Types

type Api added in v2.0.2

type Api struct {
	Prefix     string   `yaml:"prefix"`     //路由前缀
	ModuleName string   `yaml:"moduleName"` // 模块名
	Handle     []Handle `yaml:"handle"`
}

type Config added in v2.0.2

type Config struct {
	CNacos          bool    `yaml:"cNacos"`
	CRocketMQConfig bool    `yaml:"cRocketMQConfig"`
	CMysql          []Mysql `yaml:"cMysql"`
	CRedis          []Redis `yaml:"cRedis"`
}

type GoCore added in v2.0.2

type GoCore struct {
	Service       Service `yaml:"service"`
	Config        Config  `yaml:"config"`
	HttpApiEnable bool    `yaml:"httpApiEnable"` // 是否开启HttpApi,开启后生成接口表示层
	RPCEnable     bool    `yaml:"rpcEnable"`     // 是否开启 rpc server,开启后生成rpc服务器表示层
	JobEnable     bool    `yaml:"jobEnable"`     // 是否开启 Job 任务
	HttpApis      HttpApi `yaml:"httpApis"`
	Jobs          []Job   `yaml:"jobs"`
}

func GetGocoreConfig added in v2.0.2

func GetGocoreConfig() *GoCore

type Handle added in v2.0.2

type Handle struct {
	Name           string  `yaml:"name"`           // 接口名
	Method         string  `yaml:"method"`         // Get Post Any
	RequestParams  []Param `yaml:"requestParams"`  // 请求参数列表
	ResponseParams []Param `yaml:"responseParams"` // 返回参数列表
	Comment        string  `yaml:"comment"`        //接口描述
}

type HttpApi added in v2.0.2

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 added in v2.0.2

type Job struct {
	Name    string `yaml:"name"` // 任务名称
	Comment string `yaml:"comment"`
}

type Model added in v2.0.2

type Model struct {
	Name    string   `yaml:"name"`   // 表名
	Auto    bool     `yaml:"auto"`   // 是否自动创建表结构
	Fields  []string `yaml:"fields"` // 字段列表
	Comment string   `yaml:"comment"`
}

type Mysql added in v2.0.2

type Mysql struct {
	Name      string  `yaml:"name"` // Mysql名称,默认default
	HotUpdate bool    `yaml:"hotUpdate"`
	Models    []Model `yaml:"models"`
}

type MysqlDb added in v2.0.5

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 added in v2.0.2

type Param struct {
	Name     string `yaml:"name"`
	Type     string `yaml:"type"`
	Comment  string `yaml:"comment"`
	Validate string `yaml:"validate"`
}

type Redis added in v2.0.2

type Redis struct {
	Name      string         `yaml:"name"` // Redis名称,默认default
	HotUpdate bool           `yaml:"hotUpdate"`
	Index     map[string]int `yaml:"index"` // index和Key的映射关系
}

type Service added in v2.0.2

type Service struct {
	ProjectName string `yaml:"projectName"` // 项目名称
	Version     string `yaml:"version"`     // 项目版本
}

Jump to

Keyboard shortcuts

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