init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
package common
import "errors"
// FsOption 读取文件服务器配置
type FsOption struct {
BucketName string `json:"bucketName"`
AccessKey string `json:"accessKey"`
Secret string `json:"secret"`
TTL string `json:"ttl"`
}
// SelectFsOption 从配置文件中读取Bucket对应的相关值
func SelectFsOption(bucket string, FsOptions []FsOption) (FsOption, error) {
option := FsOption{}
if bucket == "" || len(FsOptions) == 0 {
return option, errors.New("bucket or FsOptions must nor be empty")
}
for _, option := range FsOptions {
if option.BucketName == bucket {
return option, nil
}
}
return option, nil
}