feat 初次提交

This commit is contained in:
2026-01-03 14:26:10 +08:00
parent f4cb8128c7
commit 506f7ed5ed
18 changed files with 885 additions and 0 deletions

19
config/config.dev.yaml Normal file
View File

@@ -0,0 +1,19 @@
app:
name: "scene-dev"
log:
debug: true
level: "debug"
maxSize: 10
maxBackups: 100
maxAge: 7
db:
etcd:
endpoints: [ "10.0.40.9:2379" ]
serve:
grpc:
address: "10.0.40.199"
port: 8601
ttl: 20

25
config/config.go Normal file
View File

@@ -0,0 +1,25 @@
package config
import "common/config"
const path = "./config"
type Config struct {
App *config.AppConfig `yaml:"app"`
Log *config.LogConfig `yaml:"log"`
DB *config.DBConfig `yaml:"db"`
Serve *config.ServeConfig `yaml:"serve"`
}
var cfg *Config
// LoadConfig 加载应用配置
func LoadConfig() error {
c, err := config.LoadConfig(path, cfg)
cfg = c
return err
}
func Get() *Config {
return cfg
}

19
config/config.prod.yaml Normal file
View File

@@ -0,0 +1,19 @@
app:
name: "scene-prod"
log:
debug: false
level: "debug"
maxSize: 10
maxBackups: 100
maxAge: 7
db:
etcd:
endpoints: [ "172.18.28.0:2379" ]
serve:
grpc:
address: "172.18.28.0"
port: 8601
ttl: 20