Documentation
¶
Overview ¶
Package taskupdate provides types and utilities for performing a2a.Task updates in response to a2a.Event-s.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is used for processing a2a.Event related to an a2a.Task. It updates the Task accordingly and uses Saver to store the new state.
func NewManager ¶
func NewManager(saver Saver, task *VersionedTask) *Manager
NewManager is a Manager constructor function.
func (*Manager) Process ¶
Process validates the event associated with the managed a2a.Task and integrates the new state into it.
func (*Manager) SetTaskFailed ¶
func (mgr *Manager) SetTaskFailed(ctx context.Context, event a2a.Event, cause error) (*VersionedTask, error)
SetTaskFailed attempts to move the Task to failed state and returns it in case of a success.
type Saver ¶
type Saver interface {
Save(ctx context.Context, task *a2a.Task, event a2a.Event, prev a2a.TaskVersion) (a2a.TaskVersion, error)
}
Saver is used for saving the a2a.Task after updating its state.
type VersionedTask ¶ added in v0.3.4
type VersionedTask struct {
Task *a2a.Task
Version a2a.TaskVersion
}
Click to show internal directories.
Click to hide internal directories.