Documentation
¶
Index ¶
- func RegisterHandlers(ctx context.Context, registrar transport.HandlerRegistrar, config *Config) error
- type A2AServer
- type AgentCardConfig
- type CancelTaskHandler
- type Config
- type EventQueue
- type InputParams
- type Logger
- type MessageHandler
- type MessageStreamingHandler
- type PushNotifier
- type ResponseEventWriter
- type TaskEventsConsolidator
- type TaskLocker
- type TaskStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
Types ¶
type A2AServer ¶
type A2AServer struct {
// contains filtered or unexported fields
}
A2AServer represents an A2A server instance
type AgentCardConfig ¶
type AgentCardConfig struct {
Name string
Description string
URL string
Version string
DocumentationURL string
Provider *models.AgentProvider
SecuritySchemes map[string]*spec.SecurityScheme
Security []map[string][]string
DefaultInputModes []string
DefaultOutputModes []string
Skills []models.AgentSkill
}
type CancelTaskHandler ¶
type CancelTaskHandler func(ctx context.Context, params *InputParams) (*models.TaskContent, error)
type Config ¶
type Config struct {
AgentCardConfig
// optional
MessageHandler MessageHandler
// optional
MessageStreamingHandler MessageStreamingHandler
// optional, uuid by default
TaskIDGenerator func(ctx context.Context) (string, error)
ContextIDGenerator func(ctx context.Context) (string, error)
// required
CancelTaskHandler CancelTaskHandler
// required
TaskEventsConsolidator TaskEventsConsolidator
// optional, log.Printf by default
Logger Logger
// optional, in-memory by default
TaskStore TaskStore
// optional, in-memory by default
TaskLocker TaskLocker
// optional, in-memory by default
Queue EventQueue
// optional, in-memory by default
PushNotifier PushNotifier
}
type EventQueue ¶
type EventQueue interface {
Push(ctx context.Context, taskID string, event *models.SendMessageStreamingResponseUnion, taskErr error) error
Pop(ctx context.Context, taskID string) (event *models.SendMessageStreamingResponseUnion, taskErr error, closed bool, err error)
Close(ctx context.Context, taskID string) error
Reset(ctx context.Context, taskID string) error
}
type InputParams ¶
type MessageHandler ¶
type MessageHandler func(ctx context.Context, params *InputParams) (*models.TaskContent, error)
type MessageStreamingHandler ¶
type MessageStreamingHandler func(ctx context.Context, params *InputParams, writer ResponseEventWriter) error
type PushNotifier ¶
type PushNotifier interface {
Set(ctx context.Context, config *models.TaskPushNotificationConfig) error
Get(ctx context.Context, taskID string) (models.PushNotificationConfig, bool, error)
Delete(ctx context.Context, taskID string) error
SendNotification(ctx context.Context, event *models.SendMessageStreamingResponseUnion) error
}
func NewInMemoryPushNotifier ¶
func NewInMemoryPushNotifier() PushNotifier
type ResponseEventWriter ¶
type ResponseEventWriter interface {
Write(event models.ResponseEvent) error
}
type TaskEventsConsolidator ¶
type TaskEventsConsolidator func(ctx context.Context, params *InputParams, events []models.ResponseEvent, handleErr error) *models.TaskContent
type TaskLocker ¶
Click to show internal directories.
Click to hide internal directories.