Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallbackFunc ¶
type CancelFunc ¶
type CancelFunc func()
type EventReadWriter ¶
type EventReadWriter interface {
EventReader
// contains filtered or unexported methods
}
func NewInMemory ¶
func NewInMemory() EventReadWriter
type EventReader ¶
type EventReader interface {
// Introduce event type filtering in the call to SubscribeUser(uesrID string, cb CallbackFunc, eventTypes ...EventType) CancelFunc
// Introduce reference filtering in the call to SubscribeUser(uesrID string, cb CallbackFunc, map[EventType][]string) CancelFunc
SubscribeUser(userID string, cb CallbackFunc) CancelFunc
SubscribeWorkspace(workspaceID string, cb CallbackFunc) CancelFunc
}
type EventSender ¶
type EventSender interface {
// User sends this event to this user only
User(id string, eventType EventType, reference string)
// Codebase sends this event to all members of this codebase
Codebase(id string, eventType EventType, reference string) error
// Workspace sends this event to all members of the codebase of this workspace
Workspace(id string, eventType EventType, reference string) error
}
TODO: support sending multiple events. Some users of this interface call methods in a loop.
func NewSender ¶
func NewSender( codebaseUserRepo db_codebase.CodebaseUserRepository, workspaceRepo db_workspace.WorkspaceReader, events EventReadWriter, ) EventSender
type EventType ¶
type EventType int
const ( CodebaseEvent EventType = iota CodebaseUpdated ViewUpdated ViewStatusUpdated WorkspaceUpdated WorkspaceUpdatedComments WorkspaceUpdatedReviews ReviewUpdated WorkspaceUpdatedActivity WorkspaceUpdatedSnapshot WorkspaceUpdatedPresence WorkspaceUpdatedSuggestion GitHubPRUpdated NotificationEvent StatusUpdated CompletedOnboardingStep WorkspaceWatchingStatusUpdated )
type TopicSubscriber ¶
Click to show internal directories.
Click to hide internal directories.