mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 06:19:20 +08:00
@@ -21,6 +21,7 @@ import (
|
||||
"github.com/openimsdk/tools/s3/cos"
|
||||
"github.com/openimsdk/tools/s3/minio"
|
||||
"github.com/openimsdk/tools/s3/oss"
|
||||
"github.com/openimsdk/tools/s3/kodo"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@@ -281,15 +282,7 @@ type Third struct {
|
||||
Enable string `mapstructure:"enable"`
|
||||
Cos Cos `mapstructure:"cos"`
|
||||
Oss Oss `mapstructure:"oss"`
|
||||
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"`
|
||||
} `mapstructure:"kodo"`
|
||||
Kodo Kodo `mapstructure:"kodo"`
|
||||
Aws struct {
|
||||
Endpoint string `mapstructure:"endpoint"`
|
||||
Region string `mapstructure:"region"`
|
||||
@@ -317,6 +310,16 @@ type Oss struct {
|
||||
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 {
|
||||
RPC struct {
|
||||
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 {
|
||||
return time.Second * time.Duration(l.FailedExpire)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user