Documentation
¶
Index ¶
- func ApplyHostNotificationHandles(event *HostNotificationEvent, senderHandle string, recipientHandle string)
- func HasDisconnectedSessions(sessions []SessionStatus) bool
- func RunForeground(resolved *appconfig.Resolved) error
- func RunService(resolved *appconfig.Resolved) error
- func SessionWarnings(sessions []SessionStatus) []string
- type DirectMessageNotificationData
- type GroupMessageNotificationData
- type GroupStateChangedNotificationData
- type HostNotificationEvent
- type HostNotifySink
- type HostNotifyStatus
- type SessionStatus
- type Status
- func ApplyRuntimePolicy(resolved *appconfig.Resolved) (Status, error)
- func EnsureInstalled(resolved *appconfig.Resolved) (Status, error)
- func Install(resolved *appconfig.Resolved) (Status, error)
- func Restart(resolved *appconfig.Resolved) (Status, error)
- func RestartService(resolved *appconfig.Resolved) (Status, error)
- func Start(resolved *appconfig.Resolved) (Status, error)
- func StartService(resolved *appconfig.Resolved) (Status, error)
- func StatusFor(resolved *appconfig.Resolved) (Status, error)
- func Stop(resolved *appconfig.Resolved) (Status, error)
- func StopService(resolved *appconfig.Resolved) (Status, error)
- func Uninstall(resolved *appconfig.Resolved) (Status, error)
- type Supervisor
- type WSClient
- func (c *WSClient) Close() error
- func (c *WSClient) Connect(ctx context.Context) error
- func (c *WSClient) Notifications() <-chan map[string]any
- func (c *WSClient) Ping(ctx context.Context) error
- func (c *WSClient) ReaderError() error
- func (c *WSClient) SendRPC(ctx context.Context, method string, params map[string]any) (map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyHostNotificationHandles ¶
func ApplyHostNotificationHandles(event *HostNotificationEvent, senderHandle string, recipientHandle string)
func HasDisconnectedSessions ¶
func HasDisconnectedSessions(sessions []SessionStatus) bool
func RunForeground ¶
func RunService ¶
func SessionWarnings ¶
func SessionWarnings(sessions []SessionStatus) []string
Types ¶
type DirectMessageNotificationData ¶
type DirectMessageNotificationData struct {
Channel string `json:"channel"`
SourceKind string `json:"source_kind,omitempty"`
MessageID string `json:"message_id"`
OperationID string `json:"operation_id,omitempty"`
ConversationID string `json:"conversation_id,omitempty"`
SenderHandle string `json:"sender_handle,omitempty"`
SenderDID string `json:"sender_did"`
RecipientHandle string `json:"recipient_handle,omitempty"`
RecipientDID string `json:"recipient_did"`
Profile string `json:"profile,omitempty"`
SecurityProfile string `json:"security_profile,omitempty"`
ContentType string `json:"content_type"`
Text string `json:"text,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
MailboxAddress string `json:"mailbox_address,omitempty"`
MailboxDID string `json:"mailbox_did,omitempty"`
FromAddr string `json:"from_addr,omitempty"`
Subject string `json:"subject,omitempty"`
Preview string `json:"preview,omitempty"`
HasAttachments bool `json:"has_attachments,omitempty"`
}
DirectMessageNotificationData is the minimal message-style payload exposed to host integrations for private notifications. It is also used as the phase-1 mail-unification envelope: mail notifications reuse the same event topic and add source_kind=mail plus mail-specific fields.
type GroupMessageNotificationData ¶
type GroupMessageNotificationData struct {
Channel string `json:"channel"`
MessageID string `json:"message_id"`
OperationID string `json:"operation_id,omitempty"`
GroupDID string `json:"group_did"`
SenderHandle string `json:"sender_handle,omitempty"`
SenderDID string `json:"sender_did"`
RecipientHandle string `json:"recipient_handle,omitempty"`
RecipientDID string `json:"recipient_did"`
Profile string `json:"profile,omitempty"`
SecurityProfile string `json:"security_profile,omitempty"`
ContentType string `json:"content_type"`
Text string `json:"text,omitempty"`
GroupStateVersion string `json:"group_state_version,omitempty"`
GroupEventSeq string `json:"group_event_seq,omitempty"`
AcceptedAt string `json:"accepted_at,omitempty"`
}
GroupMessageNotificationData is the minimal group-message payload exposed to host integrations.
type GroupStateChangedNotificationData ¶
type GroupStateChangedNotificationData struct {
Channel string `json:"channel"`
EventID string `json:"event_id"`
EventType string `json:"event_type,omitempty"`
GroupDID string `json:"group_did"`
RecipientDID string `json:"recipient_did"`
ActorDID string `json:"actor_did,omitempty"`
SubjectDID string `json:"subject_did,omitempty"`
SubjectMethod string `json:"subject_method,omitempty"`
MembershipStatus string `json:"membership_status,omitempty"`
GroupStateVersion string `json:"group_state_version,omitempty"`
GroupEventSeq string `json:"group_event_seq,omitempty"`
ChangedAt string `json:"changed_at,omitempty"`
}
GroupStateChangedNotificationData is the minimal group-state payload exposed to host integrations.
type HostNotificationEvent ¶
type HostNotificationEvent struct {
Version string `json:"version"`
ID string `json:"id"`
Topic string `json:"topic"`
ReceivedAt string `json:"received_at"`
Data any `json:"data,omitempty"`
}
HostNotificationEvent is the normalized event delivered from awiki-cli to a host-facing notification sink.
func NormalizeHostNotification ¶
func NormalizeHostNotification(notification map[string]any, receivedAt time.Time) (*HostNotificationEvent, bool)
NormalizeHostNotification converts a websocket notification into a compact host-facing event.
type HostNotifySink ¶
type HostNotifySink interface {
Notify(context.Context, HostNotificationEvent) error
Close() error
}
HostNotifySink receives normalized host notification events.
type HostNotifyStatus ¶
type HostNotifyStatus struct {
Enabled bool `json:"enabled"`
Sink string `json:"sink"`
FilePath string `json:"file_path,omitempty"`
HookURL string `json:"hook_url,omitempty"`
AgentID string `json:"agent_id,omitempty"`
HookName string `json:"hook_name,omitempty"`
NotifyURL string `json:"notify_url,omitempty"`
LastError string `json:"last_error,omitempty"`
}
type SessionStatus ¶
type Status ¶
type Status struct {
Mode string `json:"mode"`
Installed bool `json:"installed"`
Running bool `json:"running"`
BootID string `json:"boot_id,omitempty"`
PID int `json:"pid,omitempty"`
PIDFile string `json:"pid_file,omitempty"`
SocketPath string `json:"socket_path,omitempty"`
LogFile string `json:"log_file,omitempty"`
StatusFile string `json:"status_file,omitempty"`
ServiceName string `json:"service_name,omitempty"`
ServicePlatform string `json:"service_platform,omitempty"`
BridgeAvailable bool `json:"bridge_available"`
StartedAt string `json:"started_at,omitempty"`
Sessions []SessionStatus `json:"sessions,omitempty"`
HostNotify HostNotifyStatus `json:"host_notify"`
Warnings []string `json:"warnings,omitempty"`
}
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func NewSupervisor ¶
func NewSupervisor(resolved *appconfig.Resolved) (*Supervisor, error)
func (*Supervisor) Close ¶
func (s *Supervisor) Close() error
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}