local

package
v1.9.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

func NewRoomStore() streaming.RoomStore

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) Connect

func (s *ChannelStore) Connect(ctx context.Context) error

func (*ChannelStore) Create

func (s *ChannelStore) Create(ctx context.Context, channel streaming.Channel) 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) Exists

func (s *ChannelStore) Exists(ctx context.Context, channelID string) (bool, error)

func (*ChannelStore) Get

func (s *ChannelStore) Get(ctx context.Context, channelID string) (streaming.Channel, error)

func (*ChannelStore) GetSubscriberCount

func (s *ChannelStore) GetSubscriberCount(ctx context.Context, channelID string) (int, error)

func (*ChannelStore) GetSubscriptions

func (s *ChannelStore) GetSubscriptions(ctx context.Context, channelID string) ([]streaming.Subscription, error)

func (*ChannelStore) GetUserChannels

func (s *ChannelStore) GetUserChannels(ctx context.Context, userID string) ([]streaming.Channel, error)

func (*ChannelStore) IsSubscribed

func (s *ChannelStore) IsSubscribed(ctx context.Context, channelID, connID string) (bool, error)

func (*ChannelStore) List

func (s *ChannelStore) List(ctx context.Context) ([]streaming.Channel, error)

func (*ChannelStore) Ping

func (s *ChannelStore) Ping(ctx context.Context) error

func (*ChannelStore) Publish

func (s *ChannelStore) Publish(ctx context.Context, channelID string, message *streaming.Message) error

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) Delete

func (c *LocalChannel) Delete(ctx context.Context) error

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 (c *LocalChannel) IsSubscribed(ctx context.Context, connID string) (bool, error)

func (*LocalChannel) Publish

func (c *LocalChannel) Publish(ctx context.Context, message *streaming.Message) error

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) AddTag

func (r *LocalRoom) AddTag(ctx context.Context, tag string) error

func (*LocalRoom) Archive

func (r *LocalRoom) Archive(ctx context.Context) error

func (*LocalRoom) BanMember

func (r *LocalRoom) BanMember(ctx context.Context, userID string, reason string, until *time.Time) error

func (*LocalRoom) Broadcast

func (r *LocalRoom) Broadcast(ctx context.Context, message *streaming.Message) error

func (*LocalRoom) BroadcastExcept

func (r *LocalRoom) BroadcastExcept(ctx context.Context, message *streaming.Message, excludeUserIDs []string) error

func (*LocalRoom) BroadcastToRole

func (r *LocalRoom) BroadcastToRole(ctx context.Context, message *streaming.Message, role string) error

func (*LocalRoom) CreateInvite

func (r *LocalRoom) CreateInvite(ctx context.Context, opts streaming.InviteOptions) (*streaming.Invite, error)

func (*LocalRoom) Delete

func (r *LocalRoom) Delete(ctx context.Context) error

func (*LocalRoom) GetActiveMembers

func (r *LocalRoom) GetActiveMembers(ctx context.Context, since time.Duration) ([]streaming.Member, error)

func (*LocalRoom) GetBannedMembers

func (r *LocalRoom) GetBannedMembers(ctx context.Context) ([]streaming.RoomBan, error)

func (*LocalRoom) GetCategory

func (r *LocalRoom) GetCategory() string

func (*LocalRoom) GetCreated

func (r *LocalRoom) GetCreated() time.Time

func (*LocalRoom) GetDescription

func (r *LocalRoom) GetDescription() string

func (*LocalRoom) GetID

func (r *LocalRoom) GetID() string

func (*LocalRoom) GetInvites

func (r *LocalRoom) GetInvites(ctx context.Context) ([]*streaming.Invite, error)

func (*LocalRoom) GetLastReadMessage

func (r *LocalRoom) GetLastReadMessage(ctx context.Context, userID string) (string, error)

func (*LocalRoom) GetMaxMembers

func (r *LocalRoom) GetMaxMembers() int

func (*LocalRoom) GetMember

func (r *LocalRoom) GetMember(ctx context.Context, userID string) (streaming.Member, error)

func (*LocalRoom) GetMembers

func (r *LocalRoom) GetMembers(ctx context.Context) ([]streaming.Member, error)

func (*LocalRoom) GetMembersByRole

func (r *LocalRoom) GetMembersByRole(ctx context.Context, role string) ([]streaming.Member, error)

func (*LocalRoom) GetMessageCount

func (r *LocalRoom) GetMessageCount(ctx context.Context) (int64, error)

func (*LocalRoom) GetMetadata

func (r *LocalRoom) GetMetadata() map[string]any

func (*LocalRoom) GetModerationLog

func (r *LocalRoom) GetModerationLog(ctx context.Context, limit int) ([]streaming.ModerationEvent, error)

func (*LocalRoom) GetName

func (r *LocalRoom) GetName() string

func (*LocalRoom) GetOwner

func (r *LocalRoom) GetOwner() string

func (*LocalRoom) GetPinnedMessages

func (r *LocalRoom) GetPinnedMessages(ctx context.Context) ([]string, error)

func (*LocalRoom) GetSlowMode

func (r *LocalRoom) GetSlowMode(ctx context.Context) int

func (*LocalRoom) GetTags

func (r *LocalRoom) GetTags() []string

func (*LocalRoom) GetUnreadCount

func (r *LocalRoom) GetUnreadCount(ctx context.Context, userID string, since time.Time) (int, error)

func (*LocalRoom) GetUpdated

func (r *LocalRoom) GetUpdated() time.Time

func (*LocalRoom) GrantPermission

func (r *LocalRoom) GrantPermission(ctx context.Context, userID, permission string) error

func (*LocalRoom) HasPermission

func (r *LocalRoom) HasPermission(ctx context.Context, userID, permission string) (bool, error)

func (*LocalRoom) IsArchived

func (r *LocalRoom) IsArchived() bool

func (*LocalRoom) IsBanned

func (r *LocalRoom) IsBanned(ctx context.Context, userID string) (bool, error)

func (*LocalRoom) IsLocked

func (r *LocalRoom) IsLocked() bool

func (*LocalRoom) IsMember

func (r *LocalRoom) IsMember(ctx context.Context, userID string) (bool, error)

func (*LocalRoom) IsMuted

func (r *LocalRoom) IsMuted(ctx context.Context, userID string) (bool, error)

func (*LocalRoom) IsPrivate

func (r *LocalRoom) IsPrivate() bool

func (*LocalRoom) Join

func (r *LocalRoom) Join(ctx context.Context, userID, role string) error

func (*LocalRoom) JoinWithInvite

func (r *LocalRoom) JoinWithInvite(ctx context.Context, userID, inviteCode string) error

func (*LocalRoom) Leave

func (r *LocalRoom) Leave(ctx context.Context, userID string) error

func (*LocalRoom) Lock

func (r *LocalRoom) Lock(ctx context.Context, reason string) error

func (*LocalRoom) MarkAsRead

func (r *LocalRoom) MarkAsRead(ctx context.Context, userID, messageID string) error

func (*LocalRoom) MemberCount

func (r *LocalRoom) MemberCount(ctx context.Context) (int, error)

func (*LocalRoom) MuteMember

func (r *LocalRoom) MuteMember(ctx context.Context, userID string, duration time.Duration) error

func (*LocalRoom) PinMessage

func (r *LocalRoom) PinMessage(ctx context.Context, messageID string) error

func (*LocalRoom) RemoveTag

func (r *LocalRoom) RemoveTag(ctx context.Context, tag string) error

func (*LocalRoom) RevokeInvite

func (r *LocalRoom) RevokeInvite(ctx context.Context, inviteCode string) error

func (*LocalRoom) RevokePermission

func (r *LocalRoom) RevokePermission(ctx context.Context, userID, permission string) error

func (*LocalRoom) SetCategory

func (r *LocalRoom) SetCategory(ctx context.Context, category string) error

func (*LocalRoom) SetMaxMembers

func (r *LocalRoom) SetMaxMembers(ctx context.Context, max int) error

func (*LocalRoom) SetPrivate

func (r *LocalRoom) SetPrivate(ctx context.Context, private bool) error

func (*LocalRoom) SetSlowMode

func (r *LocalRoom) SetSlowMode(ctx context.Context, intervalSeconds int) error

func (*LocalRoom) TransferOwnership

func (r *LocalRoom) TransferOwnership(ctx context.Context, newOwnerID string) error

func (*LocalRoom) Unarchive

func (r *LocalRoom) Unarchive(ctx context.Context) error

func (*LocalRoom) UnbanMember

func (r *LocalRoom) UnbanMember(ctx context.Context, userID string) error

func (*LocalRoom) Unlock

func (r *LocalRoom) Unlock(ctx context.Context) error

func (*LocalRoom) UnmuteMember

func (r *LocalRoom) UnmuteMember(ctx context.Context, userID string) error

func (*LocalRoom) UnpinMessage

func (r *LocalRoom) UnpinMessage(ctx context.Context, messageID string) error

func (*LocalRoom) Update

func (r *LocalRoom) Update(ctx context.Context, updates map[string]any) error

func (*LocalRoom) UpdateMemberRole

func (r *LocalRoom) UpdateMemberRole(ctx context.Context, userID, newRole string) error

func (*LocalRoom) ValidateInvite

func (r *LocalRoom) ValidateInvite(ctx context.Context, inviteCode string) (bool, error)

type LocalSubscription

type LocalSubscription struct {
	// contains filtered or unexported fields
}

LocalSubscription implements streaming.Subscription.

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) Connect

func (s *MessageStore) Connect(ctx context.Context) error

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) DeleteOld

func (s *MessageStore) DeleteOld(ctx context.Context, olderThan time.Duration) error

func (*MessageStore) Disconnect

func (s *MessageStore) Disconnect(ctx context.Context) error

func (*MessageStore) Get

func (s *MessageStore) Get(ctx context.Context, messageID string) (*streaming.Message, error)

func (*MessageStore) GetHistory

func (s *MessageStore) GetHistory(ctx context.Context, roomID string, query streaming.HistoryQuery) ([]*streaming.Message, error)

func (*MessageStore) GetMessageCount

func (s *MessageStore) GetMessageCount(ctx context.Context, roomID string) (int64, error)

func (*MessageStore) GetMessageCountByUser

func (s *MessageStore) GetMessageCountByUser(ctx context.Context, roomID, userID string) (int64, error)

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)

func (*MessageStore) Ping

func (s *MessageStore) Ping(ctx context.Context) error

func (*MessageStore) Save

func (s *MessageStore) Save(ctx context.Context, message *streaming.Message) error

func (*MessageStore) SaveBatch

func (s *MessageStore) SaveBatch(ctx context.Context, messages []*streaming.Message) error

func (*MessageStore) Search

func (s *MessageStore) Search(ctx context.Context, roomID, searchTerm 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 (s *PresenceStore) CleanupExpired(ctx context.Context, olderThan time.Duration) error

func (*PresenceStore) Connect

func (s *PresenceStore) Connect(ctx context.Context) error

func (*PresenceStore) CountByStatus

func (s *PresenceStore) CountByStatus(ctx context.Context) (map[string]int, error)

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 (*PresenceStore) GetActiveCount

func (s *PresenceStore) GetActiveCount(ctx context.Context, since time.Duration) (int, error)

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 (s *PresenceStore) GetLastActivity(ctx context.Context, userID string) (time.Time, error)

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) IsOnline

func (s *PresenceStore) IsOnline(ctx context.Context, userID string) (bool, error)

func (*PresenceStore) Ping

func (s *PresenceStore) Ping(ctx context.Context) 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) SetOnline

func (s *PresenceStore) SetOnline(ctx context.Context, userID string, ttl time.Duration) error

func (*PresenceStore) UpdateActivity

func (s *PresenceStore) UpdateActivity(ctx context.Context, userID string, timestamp time.Time) error

type RoomStore

type RoomStore struct {
	// contains filtered or unexported fields
}

RoomStore implements streaming.RoomStore with in-memory storage.

func (*RoomStore) AddMember

func (s *RoomStore) AddMember(ctx context.Context, roomID string, member streaming.Member) error

func (*RoomStore) BanMember

func (s *RoomStore) BanMember(ctx context.Context, roomID, userID string, ban streaming.RoomBan) error

func (*RoomStore) Connect

func (s *RoomStore) Connect(ctx context.Context) error

func (*RoomStore) Create

func (s *RoomStore) Create(ctx context.Context, room streaming.Room) error

func (*RoomStore) CreateMany

func (s *RoomStore) CreateMany(ctx context.Context, rooms []streaming.Room) error

func (*RoomStore) Delete

func (s *RoomStore) Delete(ctx context.Context, roomID string) error

func (*RoomStore) DeleteInvite

func (s *RoomStore) DeleteInvite(ctx context.Context, inviteCode string) error

func (*RoomStore) DeleteMany

func (s *RoomStore) DeleteMany(ctx context.Context, roomIDs []string) error

func (*RoomStore) Disconnect

func (s *RoomStore) Disconnect(ctx context.Context) error

func (*RoomStore) Exists

func (s *RoomStore) Exists(ctx context.Context, roomID string) (bool, error)

func (*RoomStore) FindByCategory

func (s *RoomStore) FindByCategory(ctx context.Context, category string) ([]streaming.Room, error)

func (*RoomStore) FindByTag

func (s *RoomStore) FindByTag(ctx context.Context, tag string) ([]streaming.Room, error)

func (*RoomStore) Get

func (s *RoomStore) Get(ctx context.Context, roomID string) (streaming.Room, error)

func (*RoomStore) GetArchivedRooms

func (s *RoomStore) GetArchivedRooms(ctx context.Context, userID string) ([]streaming.Room, error)

func (*RoomStore) GetBans

func (s *RoomStore) GetBans(ctx context.Context, roomID string) ([]streaming.RoomBan, error)

func (*RoomStore) GetCommonRooms

func (s *RoomStore) GetCommonRooms(ctx context.Context, userID1, userID2 string) ([]streaming.Room, error)

func (*RoomStore) GetInvite

func (s *RoomStore) GetInvite(ctx context.Context, inviteCode string) (*streaming.Invite, error)

func (*RoomStore) GetMember

func (s *RoomStore) GetMember(ctx context.Context, roomID, userID string) (streaming.Member, error)

func (*RoomStore) GetMembers

func (s *RoomStore) GetMembers(ctx context.Context, roomID string) ([]streaming.Member, error)

func (*RoomStore) GetPublicRooms

func (s *RoomStore) GetPublicRooms(ctx context.Context, limit int) ([]streaming.Room, error)

func (*RoomStore) GetRoomCount

func (s *RoomStore) GetRoomCount(ctx context.Context) (int, error)

func (*RoomStore) GetTotalMembers

func (s *RoomStore) GetTotalMembers(ctx context.Context) (int, error)

func (*RoomStore) GetUserRooms

func (s *RoomStore) GetUserRooms(ctx context.Context, userID string) ([]streaming.Room, error)

func (*RoomStore) GetUserRoomsByRole

func (s *RoomStore) GetUserRoomsByRole(ctx context.Context, userID, role string) ([]streaming.Room, error)

func (*RoomStore) IsBanned

func (s *RoomStore) IsBanned(ctx context.Context, roomID, userID string) (bool, error)

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) IsMember

func (s *RoomStore) IsMember(ctx context.Context, roomID, userID string) (bool, error)

func (*RoomStore) List

func (s *RoomStore) List(ctx context.Context, filters map[string]any) ([]streaming.Room, error)

func (*RoomStore) ListInvites

func (s *RoomStore) ListInvites(ctx context.Context, roomID string) ([]*streaming.Invite, error)

func (*RoomStore) MemberCount

func (s *RoomStore) MemberCount(ctx context.Context, roomID string) (int, error)

func (*RoomStore) Ping

func (s *RoomStore) Ping(ctx context.Context) error

func (*RoomStore) RemoveMember

func (s *RoomStore) RemoveMember(ctx context.Context, roomID, userID string) error

func (*RoomStore) SaveInvite

func (s *RoomStore) SaveInvite(ctx context.Context, roomID string, invite *streaming.Invite) error

func (*RoomStore) Search

func (s *RoomStore) Search(ctx context.Context, query string, filters map[string]any) ([]streaming.Room, error)

func (*RoomStore) UnbanMember

func (s *RoomStore) UnbanMember(ctx context.Context, roomID, userID string) error

func (*RoomStore) Update

func (s *RoomStore) Update(ctx context.Context, roomID string, updates map[string]any) error

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) Connect

func (s *TypingStore) Connect(ctx context.Context) error

func (*TypingStore) Disconnect

func (s *TypingStore) Disconnect(ctx context.Context) error

func (*TypingStore) GetTypingUsers

func (s *TypingStore) GetTypingUsers(ctx context.Context, roomID string) ([]string, error)

func (*TypingStore) IsTyping

func (s *TypingStore) IsTyping(ctx context.Context, userID, roomID string) (bool, error)

func (*TypingStore) Ping

func (s *TypingStore) Ping(ctx context.Context) error

func (*TypingStore) RemoveTyping

func (s *TypingStore) RemoveTyping(ctx context.Context, userID, roomID string) error

func (*TypingStore) SetTyping

func (s *TypingStore) SetTyping(ctx context.Context, userID, roomID string, expiresAt time.Time) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL