mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
iot init
This commit is contained in:
@@ -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
8
pkg/config/mqtt.go
Normal 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
9
pkg/config/oss.go
Normal 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
6
pkg/config/queue.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package config
|
||||
|
||||
type Queue struct {
|
||||
Enable bool `yaml:" enable"`
|
||||
Num int64 `yaml:" num"` //并发数
|
||||
}
|
||||
@@ -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
9
pkg/config/taos.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user