Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 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
}