This commit is contained in:
XM-GO
2023-08-22 15:17:14 +08:00
parent 85f4f328f4
commit 4344771547
143 changed files with 13004 additions and 6957 deletions

View File

@@ -34,15 +34,18 @@ var startConfigParam *CmdConfigParam
// yaml配置文件映射对象
type Config struct {
App *App `yaml:"app"`
Server *Server `yaml:"server"`
Jwt *Jwt `yaml:"jwt"`
Redis *Redis `yaml:"redis"`
Mysql *Mysql `yaml:"mysql"`
Postgresql *Postgresql `yaml:"postgresql"`
Casbin *Casbin `yaml:"casbin"`
Gen *Gen `yaml:"gen"`
Log *Log `yaml:"log"`
App *App `yaml:"app"`
Server *Server `yaml:"server"`
Queue *Queue `yaml:"queue"`
Jwt *Jwt `yaml:"jwt"`
Redis *Redis `yaml:"redis"`
Mysql *Mysql `yaml:"mysql"`
Oss *Oss `yaml:"oss"`
Taos *Taos `yaml:"taos"`
Mqtt *Mqtt `yaml:"mqtt"`
Casbin *Casbin `yaml:"casbin"`
Gen *Gen `yaml:"gen"`
Log *Log `yaml:"log"`
}
// 配置文件内容校验

8
pkg/config/mqtt.go Normal file
View File

@@ -0,0 +1,8 @@
package config
type Mqtt struct {
Broker string `mapstructure:"broker" json:"broker" yaml:"broker"`
Qos int `mapstructure:"qos" json:"qos" yaml:"qos"`
Username string `mapstructure:"username" json:"username" yaml:"username"`
Password string `mapstructure:"password" json:"password" yaml:"password"`
}

9
pkg/config/oss.go Normal file
View File

@@ -0,0 +1,9 @@
package config
type Oss struct {
Endpoint string `yaml:"endpoint"`
AccessKey string `yaml:"accessKey"`
SecretKey string `yaml:"secretKey"`
BucketName string `yaml:"bucketName"`
UseSSL bool `yaml:"useSSL"`
}

6
pkg/config/queue.go Normal file
View File

@@ -0,0 +1,6 @@
package config
type Queue struct {
Enable bool `yaml:" enable"`
Num int64 `yaml:" num"` //并发数
}

View File

@@ -4,6 +4,7 @@ import "fmt"
type Server struct {
Port int `yaml:"port"`
GrpcPort int `yaml:"grpc-port"`
Model string `yaml:"model"`
Cors bool `yaml:"cors"`
Rate *Rate `yaml:"rate"`

9
pkg/config/taos.go Normal file
View File

@@ -0,0 +1,9 @@
package config
type Taos struct {
Host string `yaml:"host"` // 服务器地址:端口
Username string `yaml:"username"` // 数据库用户名
Password string `yaml:"password"` // 数据库密码
Database string `yaml:"database"`
Config string `yaml:"config"`
}