Documentation
¶
Index ¶
- type BusType
- type Notification
- type NotificationType
- type Publisher
- type Subscriber
- type VersionManager
- func (m *VersionManager) ClearConsoleNotification(ctx context.Context, orgId uuid.UUID, name string) error
- func (m *VersionManager) NotifyConsole(ctx context.Context, orgId uuid.UUID, name string) error
- func (m *VersionManager) Start(ctx context.Context) error
- func (m *VersionManager) StoreAndNotify(ctx context.Context, orgId uuid.UUID, name string, renderedVersion string) error
- func (m *VersionManager) WaitForNotification(ctx context.Context, orgId uuid.UUID, name string, knownRenderedVersion string) (Notification, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notification ¶ added in v1.3.0
type Notification struct {
Type NotificationType
RenderedVersion string // only populated for NotificationTypeSpecUpdated
}
Notification is the internal signal sent over the pub/sub channel to unblock a waiting GetRenderedDevice long-poll on the API server.
type NotificationType ¶ added in v1.3.0
type NotificationType string
NotificationType distinguishes between different kinds of notifications that wake a device agent's long-poll. It is intentionally decoupled from the persisted auditing Event system (api/core/v1beta1).
const ( NotificationTypeSpecUpdated NotificationType = "spec-updated" NotificationTypeConsole NotificationType = "console" )
type Publisher ¶
type Subscriber ¶
type Subscriber interface {
Subscribe(ctx context.Context, handler func(ctx context.Context, orgId uuid.UUID, name string, n Notification) error) error
}
func NewSubscriber ¶
type VersionManager ¶
type VersionManager struct {
// contains filtered or unexported fields
}
func (*VersionManager) ClearConsoleNotification ¶ added in v1.3.0
func (m *VersionManager) ClearConsoleNotification(ctx context.Context, orgId uuid.UUID, name string) error
ClearConsoleNotification removes the console-pending KV flag after the agent has been woken.
func (*VersionManager) NotifyConsole ¶ added in v1.3.0
NotifyConsole sets the console-pending KV flag and publishes a console notification so that a waiting GetRenderedDevice long-poll is unblocked immediately.
func (*VersionManager) StoreAndNotify ¶
func (*VersionManager) WaitForNotification ¶ added in v1.3.0
func (m *VersionManager) WaitForNotification(ctx context.Context, orgId uuid.UUID, name string, knownRenderedVersion string) (Notification, bool, error)
WaitForNotification blocks until a Notification occurs, then returns it. Returns (Notification{}, false, nil) on timeout — caller should return 204.