mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
Adjust configuration settings
This commit is contained in:
parent
46e07d9d16
commit
54630464bd
8
go.sum
8
go.sum
@ -264,10 +264,10 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
|
|||||||
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||||
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
|
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
|
||||||
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
|
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
|
||||||
github.com/openimsdk/protocol v0.0.59 h1:eINLjWs4pnBl33JccwHV5qUYCRm3UWk+1ED4HbDENC8=
|
github.com/openimsdk/protocol v0.0.60 h1:iz5ORGpGupkaygLTdODogUb3E4jJzSixIXMJiRkc1qs=
|
||||||
github.com/openimsdk/protocol v0.0.59/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8=
|
github.com/openimsdk/protocol v0.0.60/go.mod h1:OZQA9FR55lseYoN2Ql1XAHYKHJGu7OMNkUbuekrKCM8=
|
||||||
github.com/openimsdk/tools v0.0.47-alpha.10 h1:bel44PB4xcC1uO+1y/LYhgsPmAGpxrlNd8JaFL4yc50=
|
github.com/openimsdk/tools v0.0.47-alpha.11 h1:VioqYz2zPjoOalvdy63Ryjqnp9cwpP1p2oOoej+pbdI=
|
||||||
github.com/openimsdk/tools v0.0.47-alpha.10/go.mod h1:mUsH+ANKbdmhUih43ijJHvuYcU8owm7X3kdFH7FsIec=
|
github.com/openimsdk/tools v0.0.47-alpha.11/go.mod h1:aTh3aPbr4bibBGf0qnC3nTWC947xFOrvHsW6WZ1oV3E=
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
|
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
|
||||||
|
|||||||
@ -23,35 +23,19 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type CacheConfig struct {
|
||||||
|
Topic string `mapstructure:"topic"`
|
||||||
|
SlotNum int `mapstructure:"slotNum"`
|
||||||
|
SlotSize int `mapstructure:"slotSize"`
|
||||||
|
SuccessExpire int `mapstructure:"successExpire"`
|
||||||
|
FailedExpire int `mapstructure:"failedExpire"`
|
||||||
|
}
|
||||||
|
|
||||||
type LocalCache struct {
|
type LocalCache struct {
|
||||||
User struct {
|
User CacheConfig `mapstructure:"user"`
|
||||||
Topic string `mapstructure:"topic"`
|
Group CacheConfig `mapstructure:"group"`
|
||||||
SlotNum int `mapstructure:"slotNum"`
|
Friend CacheConfig `mapstructure:"friend"`
|
||||||
SlotSize int `mapstructure:"slotSize"`
|
Conversation CacheConfig `mapstructure:"conversation"`
|
||||||
SuccessExpire int `mapstructure:"successExpire"`
|
|
||||||
FailedExpire int `mapstructure:"failedExpire"`
|
|
||||||
} `mapstructure:"user"`
|
|
||||||
Group struct {
|
|
||||||
Topic string `mapstructure:"topic"`
|
|
||||||
SlotNum int `mapstructure:"slotNum"`
|
|
||||||
SlotSize int `mapstructure:"slotSize"`
|
|
||||||
SuccessExpire int `mapstructure:"successExpire"`
|
|
||||||
FailedExpire int `mapstructure:"failedExpire"`
|
|
||||||
} `mapstructure:"group"`
|
|
||||||
Friend struct {
|
|
||||||
Topic string `mapstructure:"topic"`
|
|
||||||
SlotNum int `mapstructure:"slotNum"`
|
|
||||||
SlotSize int `mapstructure:"slotSize"`
|
|
||||||
SuccessExpire int `mapstructure:"successExpire"`
|
|
||||||
FailedExpire int `mapstructure:"failedExpire"`
|
|
||||||
} `mapstructure:"friend"`
|
|
||||||
Conversation struct {
|
|
||||||
Topic string `mapstructure:"topic"`
|
|
||||||
SlotNum int `mapstructure:"slotNum"`
|
|
||||||
SlotSize int `mapstructure:"slotSize"`
|
|
||||||
SuccessExpire int `mapstructure:"successExpire"`
|
|
||||||
FailedExpire int `mapstructure:"failedExpire"`
|
|
||||||
} `mapstructure:"conversation"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Log struct {
|
type Log struct {
|
||||||
@ -760,14 +744,6 @@ func (r *Redis) Build() *redisutil.Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type LocalCache struct {
|
|
||||||
Topic string `yaml:"topic"`
|
|
||||||
SlotNum int `yaml:"slotNum"`
|
|
||||||
SlotSize int `yaml:"slotSize"`
|
|
||||||
SuccessExpire int `yaml:"successExpire"` // second
|
|
||||||
FailedExpire int `yaml:"failedExpire"` // second
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l LocalCache) Failed() time.Duration {
|
func (l LocalCache) Failed() time.Duration {
|
||||||
return time.Second * time.Duration(l.FailedExpire)
|
return time.Second * time.Duration(l.FailedExpire)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user