Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notification ¶
type Notification struct {
// SenderToken identifies the sending thread that is reporting this update.
SenderToken string
// IdentifierToken serves as a unique identifier to group updates together. Multiple threads may report to the same IdentifierToken.
IdentifierToken string
// Priority will be be used to select which update to show if multiple updates are received for the same IdentifierToken.
Priority int
// Message represents the text of this update.
Message string
}
Notification represents a single update reported via the channel to this notifier. These will be consolidated and displayed to the user.
type NotificationHandler ¶
type NotificationHandler interface {
Channel() chan Notification
Add(ctx context.Context)
Done(ctx context.Context)
IsClosed() bool
}
NotificationHandler receives notifications, consolidates them, and manages a single progress notification. Each time a Notification is received on the channel, it will be used to produce an updated ProgressNotification displayed to the user. The notification will remain active until all callers have called Done() on the handler.
func NewNotificationHandler ¶
func NewNotificationHandler(ctx context.Context, p notificationHandlerParams, notificationID string) (NotificationHandler, error)
NewNotificationHandler creates a new notification handler, and begins handling updates.
type NotificationManager ¶
type NotificationManager interface {
StartNotification(ctx context.Context, workspaceRoot string, title string) (NotificationHandler, error)
Delete(id string)
}
NotificationManager is to manage multiple simultaneous NotificationHandlers. StartNotification will start a new NotificationHandler, or get the existing one if present for this workspaceRoot and title combination.
func NewNotificationManager ¶
func NewNotificationManager(p NotificationManagerParams) NotificationManager
NewNotificationManager creates a new NotificationManager.
type NotificationManagerParams ¶
type NotificationManagerParams struct {
Sessions session.Repository
IdeGateway ideclient.Gateway
Logger *zap.SugaredLogger
}
NotificationManagerParams are used to initialize a new NotificationManager.