Documentation
¶
Overview ¶
Package activity reports process-owned tasks, observations, and messages to the host.
Index ¶
- Constants
- Variables
- func RegisterServer(reg grpc.ServiceRegistrar, reporter Reporter)
- func ValidateRequest(operation string, request any) error
- type Alert
- type AlertRequest
- type BeginTaskRequest
- type Binding
- func (b *Binding) BeginTask(ctx context.Context, v Spec) (Record, error)
- func (b *Binding) Bind(conn *grpc.ClientConn) error
- func (b *Binding) Close() error
- func (b *Binding) FinishTask(ctx context.Context, v FinishTaskRequest) (Record, error)
- func (b *Binding) PublishMessage(ctx context.Context, v Spec) (Record, error)
- func (b *Binding) ReportTask(ctx context.Context, v ReportTaskRequest) (Record, error)
- func (b *Binding) ResolveAlert(ctx context.Context, v ResolveAlertRequest) (Record, error)
- func (b *Binding) UpsertAlert(ctx context.Context, v AlertRequest) (Record, error)
- type Change
- type FinishTaskRequest
- type Presentation
- type Record
- type ReportTaskRequest
- type Reporter
- type ResolveAlertRequest
- type SetPresentationRequest
- type Snapshot
- type Source
- type Spec
- type StartResourceActionRequest
- type Subscription
- type Task
- type Visibility
Constants ¶
const Version uint32 = 1
Variables ¶
Functions ¶
func RegisterServer ¶
func RegisterServer(reg grpc.ServiceRegistrar, reporter Reporter)
func ValidateRequest ¶
ValidateRequest validates data shape; the host still checks ownership and transitions.
Types ¶
type AlertRequest ¶
type BeginTaskRequest ¶
type BeginTaskRequest = Spec
type Binding ¶
type Binding struct {
// contains filtered or unexported fields
}
Binding owns exactly one callback connection for the plugin process lifetime. It does not use delegated host connection grants or caller-supplied identity.
func (*Binding) FinishTask ¶
func (*Binding) PublishMessage ¶
func (*Binding) ReportTask ¶
func (*Binding) ResolveAlert ¶
func (*Binding) UpsertAlert ¶
type FinishTaskRequest ¶
type FinishTaskRequest struct {
ID string `json:"id"`
State string `json:"state"`
Presentation *Presentation `json:"presentation,omitempty"`
}
type Presentation ¶
type Presentation = resourcev2.ActivityPresentation
type Record ¶
type Record struct {
ID string `json:"id"`
Revision uint64 `json:"revision"`
Source Source `json:"source"`
Kind string `json:"kind"`
Severity string `json:"severity"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
ObservedAt string `json:"observedAt,omitempty"`
ParentID string `json:"parentId,omitempty"`
Presentation Presentation `json:"presentation"`
Task *Task `json:"task,omitempty"`
Alert *Alert `json:"alert,omitempty"`
Visibility Visibility `json:"visibility"`
}
type ReportTaskRequest ¶
type ReportTaskRequest struct {
ID string `json:"id"`
Presentation Presentation `json:"presentation"`
State string `json:"state,omitempty"`
ObservedAt string `json:"observedAt,omitempty"`
}
type Reporter ¶
type Reporter interface {
BeginTask(context.Context, Spec) (Record, error)
ReportTask(context.Context, ReportTaskRequest) (Record, error)
FinishTask(context.Context, FinishTaskRequest) (Record, error)
PublishMessage(context.Context, Spec) (Record, error)
UpsertAlert(context.Context, AlertRequest) (Record, error)
ResolveAlert(context.Context, ResolveAlertRequest) (Record, error)
}
Reporter reports observations only. The host supplies authenticated process provenance.
type ResolveAlertRequest ¶
type SetPresentationRequest ¶
type Source ¶
type Source struct {
PluginID string `json:"pluginID,omitempty"`
ConnectionID string `json:"connectionID,omitempty"`
Resource *resourcev2.ResourceNavigationIntent `json:"resource,omitempty"`
}
type Spec ¶
type Spec struct {
Presentation Presentation `json:"presentation"`
Source *Source `json:"source,omitempty"`
Severity string `json:"severity,omitempty"`
ParentID string `json:"parentId,omitempty"`
}
type StartResourceActionRequest ¶
type StartResourceActionRequest struct {
PluginID string `json:"pluginID"`
Request resourcev2.ActionRequest `json:"request"`
Presentation Presentation `json:"presentation"`
ParentID string `json:"parentId,omitempty"`
}