增加saastool功能

This commit is contained in:
2025-04-01 20:06:06 +08:00
parent 1793e2c3d9
commit 942efe107d
32 changed files with 5609 additions and 236 deletions

30
cmd/saastool/config.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"github.com/BurntSushi/toml"
)
// Config 配置
type Config struct {
Auth Auth
ApiUrls ApiUrls
}
// DB 配置
type Auth struct {
Account string
Token string
}
type ApiUrls struct {
UrlBase string
Write string
Read string
}
// LoadConfigFile 加载配置文件
func LoadConfigFile(filename string) (*Config, error) {
sc := &Config{}
_, err := toml.DecodeFile(filename, sc)
return sc, err
}