|
|
@ -21,6 +21,7 @@ import (
|
|
|
|
"github.com/openimsdk/tools/s3/cos"
|
|
|
|
"github.com/openimsdk/tools/s3/cos"
|
|
|
|
"github.com/openimsdk/tools/s3/minio"
|
|
|
|
"github.com/openimsdk/tools/s3/minio"
|
|
|
|
"github.com/openimsdk/tools/s3/oss"
|
|
|
|
"github.com/openimsdk/tools/s3/oss"
|
|
|
|
|
|
|
|
"github.com/openimsdk/tools/s3/kodo"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -281,15 +282,7 @@ type Third struct {
|
|
|
|
Enable string `mapstructure:"enable"`
|
|
|
|
Enable string `mapstructure:"enable"`
|
|
|
|
Cos Cos `mapstructure:"cos"`
|
|
|
|
Cos Cos `mapstructure:"cos"`
|
|
|
|
Oss Oss `mapstructure:"oss"`
|
|
|
|
Oss Oss `mapstructure:"oss"`
|
|
|
|
Kodo struct {
|
|
|
|
Kodo Kodo `mapstructure:"kodo"`
|
|
|
|
Endpoint string `mapstructure:"endpoint"`
|
|
|
|
|
|
|
|
Bucket string `mapstructure:"bucket"`
|
|
|
|
|
|
|
|
BucketURL string `mapstructure:"bucketURL"`
|
|
|
|
|
|
|
|
AccessKeyID string `mapstructure:"accessKeyID"`
|
|
|
|
|
|
|
|
AccessKeySecret string `mapstructure:"accessKeySecret"`
|
|
|
|
|
|
|
|
SessionToken string `mapstructure:"sessionToken"`
|
|
|
|
|
|
|
|
PublicRead bool `mapstructure:"publicRead"`
|
|
|
|
|
|
|
|
} `mapstructure:"kodo"`
|
|
|
|
|
|
|
|
Aws struct {
|
|
|
|
Aws struct {
|
|
|
|
Endpoint string `mapstructure:"endpoint"`
|
|
|
|
Endpoint string `mapstructure:"endpoint"`
|
|
|
|
Region string `mapstructure:"region"`
|
|
|
|
Region string `mapstructure:"region"`
|
|
|
@ -317,6 +310,16 @@ type Oss struct {
|
|
|
|
PublicRead bool `mapstructure:"publicRead"`
|
|
|
|
PublicRead bool `mapstructure:"publicRead"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type Kodo struct {
|
|
|
|
|
|
|
|
Endpoint string `mapstructure:"endpoint"`
|
|
|
|
|
|
|
|
Bucket string `mapstructure:"bucket"`
|
|
|
|
|
|
|
|
BucketURL string `mapstructure:"bucketURL"`
|
|
|
|
|
|
|
|
AccessKeyID string `mapstructure:"accessKeyID"`
|
|
|
|
|
|
|
|
AccessKeySecret string `mapstructure:"accessKeySecret"`
|
|
|
|
|
|
|
|
SessionToken string `mapstructure:"sessionToken"`
|
|
|
|
|
|
|
|
PublicRead bool `mapstructure:"publicRead"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
type User struct {
|
|
|
|
RPC struct {
|
|
|
|
RPC struct {
|
|
|
|
RegisterIP string `mapstructure:"registerIP"`
|
|
|
|
RegisterIP string `mapstructure:"registerIP"`
|
|
|
@ -528,6 +531,18 @@ func (o *Oss) Build() *oss.Config {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (o *Kodo) Build() *kodo.Config {
|
|
|
|
|
|
|
|
return &kodo.Config{
|
|
|
|
|
|
|
|
Endpoint: o.Endpoint,
|
|
|
|
|
|
|
|
Bucket: o.Bucket,
|
|
|
|
|
|
|
|
BucketURL: o.BucketURL,
|
|
|
|
|
|
|
|
AccessKeyID: o.AccessKeyID,
|
|
|
|
|
|
|
|
AccessKeySecret: o.AccessKeySecret,
|
|
|
|
|
|
|
|
SessionToken: o.SessionToken,
|
|
|
|
|
|
|
|
PublicRead: o.PublicRead,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (l *CacheConfig) Failed() time.Duration {
|
|
|
|
func (l *CacheConfig) Failed() time.Duration {
|
|
|
|
return time.Second * time.Duration(l.FailedExpire)
|
|
|
|
return time.Second * time.Duration(l.FailedExpire)
|
|
|
|
}
|
|
|
|
}
|
|
|
|