Documentation
¶
Index ¶
- func NewChannelStore() streaming.ChannelStore
- func NewMessageStore() streaming.MessageStore
- func NewPresenceStore() streaming.PresenceStore
- func NewRoomStore() streaming.RoomStore
- func NewTypingStore() streaming.TypingStore
- type ChannelStore
- func (s *ChannelStore) AddSubscription(ctx context.Context, channelID string, sub streaming.Subscription) error
- func (s *ChannelStore) Connect(ctx context.Context) error
- func (s *ChannelStore) Create(ctx context.Context, channel streaming.Channel) error
- func (s *ChannelStore) Delete(ctx context.Context, channelID string) error
- func (s *ChannelStore) Disconnect(ctx context.Context) error
- func (s *ChannelStore) Exists(ctx context.Context, channelID string) (bool, error)
- func (s *ChannelStore) Get(ctx context.Context, channelID string) (streaming.Channel, error)
- func (s *ChannelStore) GetSubscriberCount(ctx context.Context, channelID string) (int, error)
- func (s *ChannelStore) GetSubscriptions(ctx context.Context, channelID string) ([]streaming.Subscription, error)
- func (s *ChannelStore) GetUserChannels(ctx context.Context, userID string) ([]streaming.Channel, error)
- func (s *ChannelStore) IsSubscribed(ctx context.Context, channelID, connID string) (bool, error)
- func (s *ChannelStore) List(ctx context.Context) ([]streaming.Channel, error)
- func (s *ChannelStore) Ping(ctx context.Context) error
- func (s *ChannelStore) Publish(ctx context.Context, channelID string, message *streaming.Message) error
- func (s *ChannelStore) RemoveSubscription(ctx context.Context, channelID, connID string) error
- type LocalChannel
- func (c *LocalChannel) Delete(ctx context.Context) error
- func (c *LocalChannel) GetCreated() time.Time
- func (c *LocalChannel) GetID() string
- func (c *LocalChannel) GetMessageCount() int64
- func (c *LocalChannel) GetName() string
- func (c *LocalChannel) GetSubscriberCount(ctx context.Context) (int, error)
- func (c *LocalChannel) GetSubscribers(ctx context.Context) ([]streaming.Subscription, error)
- func (c *LocalChannel) IsSubscribed(ctx context.Context, connID string) (bool, error)
- func (c *LocalChannel) Publish(ctx context.Context, message *streaming.Message) error
- func (c *LocalChannel) Subscribe(ctx context.Context, sub streaming.Subscription) error
- func (c *LocalChannel) Unsubscribe(ctx context.Context, connID string) error
- type LocalMember
- func (m *LocalMember) GetJoinedAt() time.Time
- func (m *LocalMember) GetMetadata() map[string]any
- func (m *LocalMember) GetPermissions() []string
- func (m *LocalMember) GetRole() string
- func (m *LocalMember) GetUserID() string
- func (m *LocalMember) GrantPermission(permission string)
- func (m *LocalMember) HasPermission(permission string) bool
- func (m *LocalMember) RevokePermission(permission string)
- func (m *LocalMember) SetMetadata(key string, value any)
- func (m *LocalMember) SetRole(role string)
- type LocalRoom
- func (r *LocalRoom) AddTag(ctx context.Context, tag string) error
- func (r *LocalRoom) Archive(ctx context.Context) error
- func (r *LocalRoom) BanMember(ctx context.Context, userID string, reason string, until *time.Time) error
- func (r *LocalRoom) Broadcast(ctx context.Context, message *streaming.Message) error
- func (r *LocalRoom) BroadcastExcept(ctx context.Context, message *streaming.Message, excludeUserIDs []string) error
- func (r *LocalRoom) BroadcastToRole(ctx context.Context, message *streaming.Message, role string) error
- func (r *LocalRoom) CreateInvite(ctx context.Context, opts streaming.InviteOptions) (*streaming.Invite, error)
- func (r *LocalRoom) Delete(ctx context.Context) error
- func (r *LocalRoom) GetActiveMembers(ctx context.Context, since time.Duration) ([]streaming.Member, error)
- func (r *LocalRoom) GetBannedMembers(ctx context.Context) ([]streaming.RoomBan, error)
- func (r *LocalRoom) GetCategory() string
- func (r *LocalRoom) GetCreated() time.Time
- func (r *LocalRoom) GetDescription() string
- func (r *LocalRoom) GetID() string
- func (r *LocalRoom) GetInvites(ctx context.Context) ([]*streaming.Invite, error)
- func (r *LocalRoom) GetLastReadMessage(ctx context.Context, userID string) (string, error)
- func (r *LocalRoom) GetMaxMembers() int
- func (r *LocalRoom) GetMember(ctx context.Context, userID string) (streaming.Member, error)
- func (r *LocalRoom) GetMembers(ctx context.Context) ([]streaming.Member, error)
- func (r *LocalRoom) GetMembersByRole(ctx context.Context, role string) ([]streaming.Member, error)
- func (r *LocalRoom) GetMessageCount(ctx context.Context) (int64, error)
- func (r *LocalRoom) GetMetadata() map[string]any
- func (r *LocalRoom) GetModerationLog(ctx context.Context, limit int) ([]streaming.ModerationEvent, error)
- func (r *LocalRoom) GetName() string
- func (r *LocalRoom) GetOwner() string
- func (r *LocalRoom) GetPinnedMessages(ctx context.Context) ([]string, error)
- func (r *LocalRoom) GetSlowMode(ctx context.Context) int
- func (r *LocalRoom) GetTags() []string
- func (r *LocalRoom) GetUnreadCount(ctx context.Context, userID string, since time.Time) (int, error)
- func (r *LocalRoom) GetUpdated() time.Time
- func (r *LocalRoom) GrantPermission(ctx context.Context, userID, permission string) error
- func (r *LocalRoom) HasPermission(ctx context.Context, userID, permission string) (bool, error)
- func (r *LocalRoom) IsArchived() bool
- func (r *LocalRoom) IsBanned(ctx context.Context, userID string) (bool, error)
- func (r *LocalRoom) IsLocked() bool
- func (r *LocalRoom) IsMember(ctx context.Context, userID string) (bool, error)
- func (r *LocalRoom) IsMuted(ctx context.Context, userID string) (bool, error)
- func (r *LocalRoom) IsPrivate() bool
- func (r *LocalRoom) Join(ctx context.Context, userID, role string) error
- func (r *LocalRoom) JoinWithInvite(ctx context.Context, userID, inviteCode string) error
- func (r *LocalRoom) Leave(ctx context.Context, userID string) error
- func (r *LocalRoom) Lock(ctx context.Context, reason string) error
- func (r *LocalRoom) MarkAsRead(ctx context.Context, userID, messageID string) error
- func (r *LocalRoom) MemberCount(ctx context.Context) (int, error)
- func (r *LocalRoom) MuteMember(ctx context.Context, userID string, duration time.Duration) error
- func (r *LocalRoom) PinMessage(ctx context.Context, messageID string) error
- func (r *LocalRoom) RemoveTag(ctx context.Context, tag string) error
- func (r *LocalRoom) RevokeInvite(ctx context.Context, inviteCode string) error
- func (r *LocalRoom) RevokePermission(ctx context.Context, userID, permission string) error
- func (r *LocalRoom) SetCategory(ctx context.Context, category string) error
- func (r *LocalRoom) SetMaxMembers(ctx context.Context, max int) error
- func (r *LocalRoom) SetPrivate(ctx context.Context, private bool) error
- func (r *LocalRoom) SetSlowMode(ctx context.Context, intervalSeconds int) error
- func (r *LocalRoom) TransferOwnership(ctx context.Context, newOwnerID string) error
- func (r *LocalRoom) Unarchive(ctx context.Context) error
- func (r *LocalRoom) UnbanMember(ctx context.Context, userID string) error
- func (r *LocalRoom) Unlock(ctx context.Context) error
- func (r *LocalRoom) UnmuteMember(ctx context.Context, userID string) error
- func (r *LocalRoom) UnpinMessage(ctx context.Context, messageID string) error
- func (r *LocalRoom) Update(ctx context.Context, updates map[string]any) error
- func (r *LocalRoom) UpdateMemberRole(ctx context.Context, userID, newRole string) error
- func (r *LocalRoom) ValidateInvite(ctx context.Context, inviteCode string) (bool, error)
- type LocalSubscription
- func (s *LocalSubscription) GetConnID() string
- func (s *LocalSubscription) GetFilters() map[string]any
- func (s *LocalSubscription) GetSubscribedAt() time.Time
- func (s *LocalSubscription) GetUserID() string
- func (s *LocalSubscription) MatchesFilter(message *streaming.Message) bool
- func (s *LocalSubscription) SetFilters(filters map[string]any)
- type MessageStore
- func (s *MessageStore) Connect(ctx context.Context) error
- func (s *MessageStore) Delete(ctx context.Context, messageID string) error
- func (s *MessageStore) DeleteByRoom(ctx context.Context, roomID string) error
- func (s *MessageStore) DeleteByUser(ctx context.Context, userID string) error
- func (s *MessageStore) DeleteOld(ctx context.Context, olderThan time.Duration) error
- func (s *MessageStore) Disconnect(ctx context.Context) error
- func (s *MessageStore) Get(ctx context.Context, messageID string) (*streaming.Message, error)
- func (s *MessageStore) GetHistory(ctx context.Context, roomID string, query streaming.HistoryQuery) ([]*streaming.Message, error)
- func (s *MessageStore) GetMessageCount(ctx context.Context, roomID string) (int64, error)
- func (s *MessageStore) GetMessageCountByUser(ctx context.Context, roomID, userID string) (int64, error)
- func (s *MessageStore) GetSince(ctx context.Context, roomID string, afterSequence int64, limit int) ([]*streaming.Message, error)
- func (s *MessageStore) GetThreadHistory(ctx context.Context, roomID, threadID string, query streaming.HistoryQuery) ([]*streaming.Message, error)
- func (s *MessageStore) GetUserMessages(ctx context.Context, userID string, query streaming.HistoryQuery) ([]*streaming.Message, error)
- func (s *MessageStore) Ping(ctx context.Context) error
- func (s *MessageStore) Save(ctx context.Context, message *streaming.Message) error
- func (s *MessageStore) SaveBatch(ctx context.Context, messages []*streaming.Message) error
- func (s *MessageStore) Search(ctx context.Context, roomID, searchTerm string, query streaming.HistoryQuery) ([]*streaming.Message, error)
- type PresenceStore
- func (s *PresenceStore) CleanupExpired(ctx context.Context, olderThan time.Duration) error
- func (s *PresenceStore) Connect(ctx context.Context) error
- func (s *PresenceStore) CountByStatus(ctx context.Context) (map[string]int, error)
- func (s *PresenceStore) Delete(ctx context.Context, userID string) error
- func (s *PresenceStore) DeleteMultiple(ctx context.Context, userIDs []string) error
- func (s *PresenceStore) Disconnect(ctx context.Context) error
- func (s *PresenceStore) Get(ctx context.Context, userID string) (*streaming.UserPresence, error)
- func (s *PresenceStore) GetActiveCount(ctx context.Context, since time.Duration) (int, error)
- func (s *PresenceStore) GetByStatus(ctx context.Context, status string) ([]*streaming.UserPresence, error)
- func (s *PresenceStore) GetDevices(ctx context.Context, userID string) ([]streaming.DeviceInfo, error)
- func (s *PresenceStore) GetHistory(ctx context.Context, userID string, limit int) ([]*streaming.PresenceEvent, error)
- func (s *PresenceStore) GetHistorySince(ctx context.Context, userID string, since time.Time) ([]*streaming.PresenceEvent, error)
- func (s *PresenceStore) GetLastActivity(ctx context.Context, userID string) (time.Time, error)
- func (s *PresenceStore) GetMultiple(ctx context.Context, userIDs []string) ([]*streaming.UserPresence, error)
- func (s *PresenceStore) GetOnline(ctx context.Context) ([]string, error)
- func (s *PresenceStore) GetRecent(ctx context.Context, status string, since time.Duration) ([]*streaming.UserPresence, error)
- func (s *PresenceStore) GetWithFilters(ctx context.Context, filters streaming.PresenceFilters) ([]*streaming.UserPresence, error)
- func (s *PresenceStore) IsOnline(ctx context.Context, userID string) (bool, error)
- func (s *PresenceStore) Ping(ctx context.Context) error
- func (s *PresenceStore) RemoveDevice(ctx context.Context, userID, deviceID string) error
- func (s *PresenceStore) SaveHistory(ctx context.Context, userID string, event *streaming.PresenceEvent) error
- func (s *PresenceStore) Set(ctx context.Context, userID string, presence *streaming.UserPresence) error
- func (s *PresenceStore) SetDevice(ctx context.Context, userID, deviceID string, device streaming.DeviceInfo) error
- func (s *PresenceStore) SetMultiple(ctx context.Context, presences map[string]*streaming.UserPresence) error
- func (s *PresenceStore) SetOffline(ctx context.Context, userID string) error
- func (s *PresenceStore) SetOnline(ctx context.Context, userID string, ttl time.Duration) error
- func (s *PresenceStore) UpdateActivity(ctx context.Context, userID string, timestamp time.Time) error
- type RoomStore
- func (s *RoomStore) AddMember(ctx context.Context, roomID string, member streaming.Member) error
- func (s *RoomStore) BanMember(ctx context.Context, roomID, userID string, ban streaming.RoomBan) error
- func (s *RoomStore) Connect(ctx context.Context) error
- func (s *RoomStore) Create(ctx context.Context, room streaming.Room) error
- func (s *RoomStore) CreateMany(ctx context.Context, rooms []streaming.Room) error
- func (s *RoomStore) Delete(ctx context.Context, roomID string) error
- func (s *RoomStore) DeleteInvite(ctx context.Context, inviteCode string) error
- func (s *RoomStore) DeleteMany(ctx context.Context, roomIDs []string) error
- func (s *RoomStore) Disconnect(ctx context.Context) error
- func (s *RoomStore) Exists(ctx context.Context, roomID string) (bool, error)
- func (s *RoomStore) FindByCategory(ctx context.Context, category string) ([]streaming.Room, error)
- func (s *RoomStore) FindByTag(ctx context.Context, tag string) ([]streaming.Room, error)
- func (s *RoomStore) Get(ctx context.Context, roomID string) (streaming.Room, error)
- func (s *RoomStore) GetArchivedRooms(ctx context.Context, userID string) ([]streaming.Room, error)
- func (s *RoomStore) GetBans(ctx context.Context, roomID string) ([]streaming.RoomBan, error)
- func (s *RoomStore) GetCommonRooms(ctx context.Context, userID1, userID2 string) ([]streaming.Room, error)
- func (s *RoomStore) GetInvite(ctx context.Context, inviteCode string) (*streaming.Invite, error)
- func (s *RoomStore) GetMember(ctx context.Context, roomID, userID string) (streaming.Member, error)
- func (s *RoomStore) GetMembers(ctx context.Context, roomID string) ([]streaming.Member, error)
- func (s *RoomStore) GetPublicRooms(ctx context.Context, limit int) ([]streaming.Room, error)
- func (s *RoomStore) GetRoomCount(ctx context.Context) (int, error)
- func (s *RoomStore) GetTotalMembers(ctx context.Context) (int, error)
- func (s *RoomStore) GetUserRooms(ctx context.Context, userID string) ([]streaming.Room, error)
- func (s *RoomStore) GetUserRoomsByRole(ctx context.Context, userID, role string) ([]streaming.Room, error)
- func (s *RoomStore) IsBanned(ctx context.Context, roomID, userID string) (bool, error)
- func (s *RoomStore) IsMember(ctx context.Context, roomID, userID string) (bool, error)
- func (s *RoomStore) List(ctx context.Context, filters map[string]any) ([]streaming.Room, error)
- func (s *RoomStore) ListInvites(ctx context.Context, roomID string) ([]*streaming.Invite, error)
- func (s *RoomStore) MemberCount(ctx context.Context, roomID string) (int, error)
- func (s *RoomStore) Ping(ctx context.Context) error
- func (s *RoomStore) RemoveMember(ctx context.Context, roomID, userID string) error
- func (s *RoomStore) SaveInvite(ctx context.Context, roomID string, invite *streaming.Invite) error
- func (s *RoomStore) Search(ctx context.Context, query string, filters map[string]any) ([]streaming.Room, error)
- func (s *RoomStore) UnbanMember(ctx context.Context, roomID, userID string) error
- func (s *RoomStore) Update(ctx context.Context, roomID string, updates map[string]any) error
- type TypingStore
- func (s *TypingStore) CleanupExpired(ctx context.Context) error
- func (s *TypingStore) Connect(ctx context.Context) error
- func (s *TypingStore) Disconnect(ctx context.Context) error
- func (s *TypingStore) GetTypingUsers(ctx context.Context, roomID string) ([]string, error)
- func (s *TypingStore) IsTyping(ctx context.Context, userID, roomID string) (bool, error)
- func (s *TypingStore) Ping(ctx context.Context) error
- func (s *TypingStore) RemoveTyping(ctx context.Context, userID, roomID string) error
- func (s *TypingStore) SetTyping(ctx context.Context, userID, roomID string, expiresAt time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewChannelStore ¶
func NewChannelStore() streaming.ChannelStore
NewChannelStore creates a new local channel store.
func NewMessageStore ¶
func NewMessageStore() streaming.MessageStore
NewMessageStore creates a new local message store.
func NewPresenceStore ¶
func NewPresenceStore() streaming.PresenceStore
NewPresenceStore creates a new local presence store.
func NewRoomStore ¶
NewRoomStore creates a new local room store.
func NewTypingStore ¶
func NewTypingStore() streaming.TypingStore
NewTypingStore creates a new local typing store.
Types ¶
type ChannelStore ¶
type ChannelStore struct {
// contains filtered or unexported fields
}
ChannelStore implements streaming.ChannelStore with in-memory storage.
func (*ChannelStore) AddSubscription ¶
func (s *ChannelStore) AddSubscription(ctx context.Context, channelID string, sub streaming.Subscription) error
func (*ChannelStore) Delete ¶
func (s *ChannelStore) Delete(ctx context.Context, channelID string) error
func (*ChannelStore) Disconnect ¶
func (s *ChannelStore) Disconnect(ctx context.Context) error
func (*ChannelStore) GetSubscriberCount ¶
func (*ChannelStore) GetSubscriptions ¶
func (s *ChannelStore) GetSubscriptions(ctx context.Context, channelID string) ([]streaming.Subscription, error)
func (*ChannelStore) GetUserChannels ¶
func (*ChannelStore) IsSubscribed ¶
func (*ChannelStore) RemoveSubscription ¶
func (s *ChannelStore) RemoveSubscription(ctx context.Context, channelID, connID string) error
type LocalChannel ¶
type LocalChannel struct {
// contains filtered or unexported fields
}
LocalChannel implements streaming.Channel.
func NewLocalChannel ¶
func NewLocalChannel(opts streaming.ChannelOptions) *LocalChannel
func (*LocalChannel) GetCreated ¶
func (c *LocalChannel) GetCreated() time.Time
func (*LocalChannel) GetID ¶
func (c *LocalChannel) GetID() string
func (*LocalChannel) GetMessageCount ¶
func (c *LocalChannel) GetMessageCount() int64
func (*LocalChannel) GetName ¶
func (c *LocalChannel) GetName() string
func (*LocalChannel) GetSubscriberCount ¶
func (c *LocalChannel) GetSubscriberCount(ctx context.Context) (int, error)
func (*LocalChannel) GetSubscribers ¶
func (c *LocalChannel) GetSubscribers(ctx context.Context) ([]streaming.Subscription, error)
func (*LocalChannel) IsSubscribed ¶
func (*LocalChannel) Subscribe ¶
func (c *LocalChannel) Subscribe(ctx context.Context, sub streaming.Subscription) error
func (*LocalChannel) Unsubscribe ¶
func (c *LocalChannel) Unsubscribe(ctx context.Context, connID string) error
type LocalMember ¶
type LocalMember struct {
// contains filtered or unexported fields
}
LocalMember implements streaming.Member.
func NewLocalMember ¶
func NewLocalMember(opts streaming.MemberOptions) *LocalMember
func (*LocalMember) GetJoinedAt ¶
func (m *LocalMember) GetJoinedAt() time.Time
func (*LocalMember) GetMetadata ¶
func (m *LocalMember) GetMetadata() map[string]any
func (*LocalMember) GetPermissions ¶
func (m *LocalMember) GetPermissions() []string
func (*LocalMember) GetRole ¶
func (m *LocalMember) GetRole() string
func (*LocalMember) GetUserID ¶
func (m *LocalMember) GetUserID() string
func (*LocalMember) GrantPermission ¶
func (m *LocalMember) GrantPermission(permission string)
GrantPermission adds a permission if the member does not already hold it.
The duplicate check is inlined rather than delegated to HasPermission: sync.RWMutex is not reentrant, so taking RLock while already holding Lock deadlocks the calling goroutine outright.
func (*LocalMember) HasPermission ¶
func (m *LocalMember) HasPermission(permission string) bool
func (*LocalMember) RevokePermission ¶
func (m *LocalMember) RevokePermission(permission string)
func (*LocalMember) SetMetadata ¶
func (m *LocalMember) SetMetadata(key string, value any)
func (*LocalMember) SetRole ¶
func (m *LocalMember) SetRole(role string)
type LocalRoom ¶
type LocalRoom struct {
// contains filtered or unexported fields
}
Room implements streaming.Room for local backend.
func NewRoom ¶
func NewRoom(opts streaming.RoomOptions) *LocalRoom
NewRoom builds a LocalRoom from the given options.
Every map and slice field is initialised here. They used to be left nil, which made MuteMember and MarkAsRead panic on any room built through this constructor — only RoomStore.Create's foreign-Room conversion path had initialised them.
func (*LocalRoom) BroadcastExcept ¶
func (*LocalRoom) BroadcastToRole ¶
func (*LocalRoom) CreateInvite ¶
func (*LocalRoom) GetActiveMembers ¶
func (*LocalRoom) GetBannedMembers ¶
func (*LocalRoom) GetCategory ¶
func (*LocalRoom) GetCreated ¶
func (*LocalRoom) GetDescription ¶
func (*LocalRoom) GetInvites ¶
func (*LocalRoom) GetLastReadMessage ¶
func (*LocalRoom) GetMaxMembers ¶
func (*LocalRoom) GetMembers ¶
func (*LocalRoom) GetMembersByRole ¶
func (*LocalRoom) GetMessageCount ¶
func (*LocalRoom) GetMetadata ¶
func (*LocalRoom) GetModerationLog ¶
func (*LocalRoom) GetPinnedMessages ¶
func (*LocalRoom) GetUnreadCount ¶
func (*LocalRoom) GetUpdated ¶
func (*LocalRoom) GrantPermission ¶
func (*LocalRoom) HasPermission ¶
func (*LocalRoom) IsArchived ¶
func (*LocalRoom) JoinWithInvite ¶
func (*LocalRoom) MarkAsRead ¶
func (*LocalRoom) MuteMember ¶
func (*LocalRoom) PinMessage ¶
func (*LocalRoom) RevokeInvite ¶
func (*LocalRoom) RevokePermission ¶
func (*LocalRoom) SetCategory ¶
func (*LocalRoom) SetMaxMembers ¶
func (*LocalRoom) SetPrivate ¶
func (*LocalRoom) SetSlowMode ¶
func (*LocalRoom) TransferOwnership ¶
func (*LocalRoom) UnbanMember ¶
func (*LocalRoom) UnmuteMember ¶
func (*LocalRoom) UnpinMessage ¶
func (*LocalRoom) UpdateMemberRole ¶
type LocalSubscription ¶
type LocalSubscription struct {
// contains filtered or unexported fields
}
LocalSubscription implements streaming.Subscription.
func NewLocalSubscription ¶
func NewLocalSubscription(opts streaming.SubscriptionOptions) *LocalSubscription
func (*LocalSubscription) GetConnID ¶
func (s *LocalSubscription) GetConnID() string
func (*LocalSubscription) GetFilters ¶
func (s *LocalSubscription) GetFilters() map[string]any
func (*LocalSubscription) GetSubscribedAt ¶
func (s *LocalSubscription) GetSubscribedAt() time.Time
func (*LocalSubscription) GetUserID ¶
func (s *LocalSubscription) GetUserID() string
func (*LocalSubscription) MatchesFilter ¶
func (s *LocalSubscription) MatchesFilter(message *streaming.Message) bool
func (*LocalSubscription) SetFilters ¶
func (s *LocalSubscription) SetFilters(filters map[string]any)
type MessageStore ¶
type MessageStore struct {
// contains filtered or unexported fields
}
MessageStore implements streaming.MessageStore with in-memory storage.
func (*MessageStore) Delete ¶
func (s *MessageStore) Delete(ctx context.Context, messageID string) error
func (*MessageStore) DeleteByRoom ¶
func (s *MessageStore) DeleteByRoom(ctx context.Context, roomID string) error
func (*MessageStore) DeleteByUser ¶
func (s *MessageStore) DeleteByUser(ctx context.Context, userID string) error
func (*MessageStore) Disconnect ¶
func (s *MessageStore) Disconnect(ctx context.Context) error
func (*MessageStore) GetHistory ¶
func (s *MessageStore) GetHistory(ctx context.Context, roomID string, query streaming.HistoryQuery) ([]*streaming.Message, error)
func (*MessageStore) GetMessageCount ¶
func (*MessageStore) GetMessageCountByUser ¶
func (*MessageStore) GetSince ¶ added in v1.9.5
func (s *MessageStore) GetSince( ctx context.Context, roomID string, afterSequence int64, limit int, ) ([]*streaming.Message, error)
GetSince returns messages in a room after the given sequence, oldest first.
Sorted rather than assumed to be in insertion order: Save appends to the room index, but SaveBatch and replicated messages can land out of order, and a resume that returns the gap shuffled is a client that renders history wrong.
func (*MessageStore) GetThreadHistory ¶
func (s *MessageStore) GetThreadHistory(ctx context.Context, roomID, threadID string, query streaming.HistoryQuery) ([]*streaming.Message, error)
func (*MessageStore) GetUserMessages ¶
func (s *MessageStore) GetUserMessages(ctx context.Context, userID string, query streaming.HistoryQuery) ([]*streaming.Message, error)
type PresenceStore ¶
type PresenceStore struct {
// contains filtered or unexported fields
}
PresenceStore implements streaming.PresenceStore with in-memory storage.
func (*PresenceStore) CleanupExpired ¶
func (*PresenceStore) CountByStatus ¶
func (*PresenceStore) Delete ¶
func (s *PresenceStore) Delete(ctx context.Context, userID string) error
func (*PresenceStore) DeleteMultiple ¶
func (s *PresenceStore) DeleteMultiple(ctx context.Context, userIDs []string) error
func (*PresenceStore) Disconnect ¶
func (s *PresenceStore) Disconnect(ctx context.Context) error
func (*PresenceStore) Get ¶
func (s *PresenceStore) Get(ctx context.Context, userID string) (*streaming.UserPresence, error)
func (*PresenceStore) GetActiveCount ¶
func (*PresenceStore) GetByStatus ¶
func (s *PresenceStore) GetByStatus(ctx context.Context, status string) ([]*streaming.UserPresence, error)
func (*PresenceStore) GetDevices ¶
func (s *PresenceStore) GetDevices(ctx context.Context, userID string) ([]streaming.DeviceInfo, error)
func (*PresenceStore) GetHistory ¶
func (s *PresenceStore) GetHistory(ctx context.Context, userID string, limit int) ([]*streaming.PresenceEvent, error)
func (*PresenceStore) GetHistorySince ¶
func (s *PresenceStore) GetHistorySince(ctx context.Context, userID string, since time.Time) ([]*streaming.PresenceEvent, error)
func (*PresenceStore) GetLastActivity ¶
func (*PresenceStore) GetMultiple ¶
func (s *PresenceStore) GetMultiple(ctx context.Context, userIDs []string) ([]*streaming.UserPresence, error)
func (*PresenceStore) GetOnline ¶
func (s *PresenceStore) GetOnline(ctx context.Context) ([]string, error)
func (*PresenceStore) GetRecent ¶
func (s *PresenceStore) GetRecent(ctx context.Context, status string, since time.Duration) ([]*streaming.UserPresence, error)
func (*PresenceStore) GetWithFilters ¶
func (s *PresenceStore) GetWithFilters(ctx context.Context, filters streaming.PresenceFilters) ([]*streaming.UserPresence, error)
func (*PresenceStore) RemoveDevice ¶
func (s *PresenceStore) RemoveDevice(ctx context.Context, userID, deviceID string) error
func (*PresenceStore) SaveHistory ¶
func (s *PresenceStore) SaveHistory(ctx context.Context, userID string, event *streaming.PresenceEvent) error
func (*PresenceStore) Set ¶
func (s *PresenceStore) Set(ctx context.Context, userID string, presence *streaming.UserPresence) error
func (*PresenceStore) SetDevice ¶
func (s *PresenceStore) SetDevice(ctx context.Context, userID, deviceID string, device streaming.DeviceInfo) error
func (*PresenceStore) SetMultiple ¶
func (s *PresenceStore) SetMultiple(ctx context.Context, presences map[string]*streaming.UserPresence) error
func (*PresenceStore) SetOffline ¶
func (s *PresenceStore) SetOffline(ctx context.Context, userID string) error
func (*PresenceStore) UpdateActivity ¶
type RoomStore ¶
type RoomStore struct {
// contains filtered or unexported fields
}
RoomStore implements streaming.RoomStore with in-memory storage.
func (*RoomStore) CreateMany ¶
func (*RoomStore) DeleteInvite ¶
func (*RoomStore) DeleteMany ¶
func (*RoomStore) FindByCategory ¶
func (*RoomStore) GetArchivedRooms ¶
func (*RoomStore) GetCommonRooms ¶
func (*RoomStore) GetMembers ¶
func (*RoomStore) GetPublicRooms ¶
func (*RoomStore) GetTotalMembers ¶
func (*RoomStore) GetUserRooms ¶
func (*RoomStore) GetUserRoomsByRole ¶
func (*RoomStore) IsBanned ¶
IsBanned reports whether a user is currently banned from a room.
An expired ban answers false but is left in place rather than deleted here: this is a read path holding only an RLock, and deleting from the map under a read lock races with every concurrent reader. Expired entries are reclaimed by UnbanMember and by the next BanMember for the same user, and GetBans filters them out, so nothing observes the stale row.
func (*RoomStore) ListInvites ¶
func (*RoomStore) MemberCount ¶
func (*RoomStore) RemoveMember ¶
func (*RoomStore) SaveInvite ¶
func (*RoomStore) UnbanMember ¶
type TypingStore ¶
type TypingStore struct {
// contains filtered or unexported fields
}
TypingStore implements streaming.TypingStore with in-memory storage.
func (*TypingStore) CleanupExpired ¶
func (s *TypingStore) CleanupExpired(ctx context.Context) error
func (*TypingStore) Disconnect ¶
func (s *TypingStore) Disconnect(ctx context.Context) error
func (*TypingStore) GetTypingUsers ¶
func (*TypingStore) RemoveTyping ¶
func (s *TypingStore) RemoveTyping(ctx context.Context, userID, roomID string) error