mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-07 05:30:37 +02:00
sdk: mutelist cache.
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
type System struct {
|
||||
RelayListCache cache.Cache32[RelayList]
|
||||
FollowListCache cache.Cache32[FollowList]
|
||||
MuteListCache cache.Cache32[FollowList]
|
||||
MetadataCache cache.Cache32[ProfileMetadata]
|
||||
Hints hints.HintsDB
|
||||
Pool *nostr.SimplePool
|
||||
@@ -54,6 +55,7 @@ func NewSystem(mods ...SystemModifier) *System {
|
||||
sys := &System{
|
||||
RelayListCache: cache_memory.New32[RelayList](1000),
|
||||
FollowListCache: cache_memory.New32[FollowList](1000),
|
||||
MuteListCache: cache_memory.New32[FollowList](1000),
|
||||
MetadataCache: cache_memory.New32[ProfileMetadata](1000),
|
||||
RelayListRelays: NewRelayStream("wss://purplepag.es", "wss://user.kindpag.es", "wss://relay.nos.social"),
|
||||
FollowListRelays: NewRelayStream("wss://purplepag.es", "wss://user.kindpag.es", "wss://relay.nos.social"),
|
||||
@@ -173,6 +175,12 @@ func WithFollowListCache(cache cache.Cache32[FollowList]) SystemModifier {
|
||||
}
|
||||
}
|
||||
|
||||
func WithMuteListCache(cache cache.Cache32[FollowList]) SystemModifier {
|
||||
return func(sys *System) {
|
||||
sys.MuteListCache = cache
|
||||
}
|
||||
}
|
||||
|
||||
func WithMetadataCache(cache cache.Cache32[ProfileMetadata]) SystemModifier {
|
||||
return func(sys *System) {
|
||||
sys.MetadataCache = cache
|
||||
|
Reference in New Issue
Block a user