Documentation
¶
Overview ¶
Package a2agrpc provides an A2A gRPC service implementation which can be registered with grpc.Server. The implementation performs protobuf translation and delegates the actual method handling to a transport-agnostic a2asrv.RequestHandler.
grpcHandler := a2agrpc.NewHandler(requestHandler)
s := grpc.NewServer()
grpcHandler.RegisterWith(s)
if err := s.Serve(listener); err != nil && !errors.Is(err, grpc.ErrServerStopped) {
log.Fatalf("Server exited with error: %v", err)
}
Index ¶
- type Handler
- func (h *Handler) CancelTask(ctx context.Context, req *a2apb.CancelTaskRequest) (*a2apb.Task, error)
- func (h *Handler) CreateTaskPushNotificationConfig(ctx context.Context, req *a2apb.CreateTaskPushNotificationConfigRequest) (*a2apb.TaskPushNotificationConfig, error)
- func (h *Handler) DeleteTaskPushNotificationConfig(ctx context.Context, req *a2apb.DeleteTaskPushNotificationConfigRequest) (*emptypb.Empty, error)
- func (h *Handler) GetAgentCard(ctx context.Context, req *a2apb.GetAgentCardRequest) (*a2apb.AgentCard, error)
- func (h *Handler) GetTask(ctx context.Context, req *a2apb.GetTaskRequest) (*a2apb.Task, error)
- func (h *Handler) GetTaskPushNotificationConfig(ctx context.Context, req *a2apb.GetTaskPushNotificationConfigRequest) (*a2apb.TaskPushNotificationConfig, error)
- func (h *Handler) ListTaskPushNotificationConfig(ctx context.Context, req *a2apb.ListTaskPushNotificationConfigRequest) (*a2apb.ListTaskPushNotificationConfigResponse, error)
- func (h *Handler) RegisterWith(s *grpc.Server)
- func (h *Handler) SendMessage(ctx context.Context, req *a2apb.SendMessageRequest) (*a2apb.SendMessageResponse, error)
- func (h *Handler) SendStreamingMessage(req *a2apb.SendMessageRequest, ...) error
- func (h *Handler) TaskSubscription(req *a2apb.TaskSubscriptionRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
a2apb.UnimplementedA2AServiceServer
// contains filtered or unexported fields
}
Handler implements protobuf translation layer and delegates the actual method handling to a2asrv.RequestHandler.
func NewHandler ¶
func NewHandler(handler a2asrv.RequestHandler) *Handler
NewHandler is a Handler constructor function.
func (*Handler) CancelTask ¶
func (*Handler) CreateTaskPushNotificationConfig ¶
func (h *Handler) CreateTaskPushNotificationConfig(ctx context.Context, req *a2apb.CreateTaskPushNotificationConfigRequest) (*a2apb.TaskPushNotificationConfig, error)
func (*Handler) DeleteTaskPushNotificationConfig ¶
func (*Handler) GetAgentCard ¶
func (*Handler) GetTaskPushNotificationConfig ¶
func (h *Handler) GetTaskPushNotificationConfig(ctx context.Context, req *a2apb.GetTaskPushNotificationConfigRequest) (*a2apb.TaskPushNotificationConfig, error)
func (*Handler) ListTaskPushNotificationConfig ¶
func (h *Handler) ListTaskPushNotificationConfig(ctx context.Context, req *a2apb.ListTaskPushNotificationConfigRequest) (*a2apb.ListTaskPushNotificationConfigResponse, error)
func (*Handler) RegisterWith ¶
RegisterWith registers as an A2AService implementation with the provided grpc.Server.
func (*Handler) SendMessage ¶
func (h *Handler) SendMessage(ctx context.Context, req *a2apb.SendMessageRequest) (*a2apb.SendMessageResponse, error)
func (*Handler) SendStreamingMessage ¶
func (h *Handler) SendStreamingMessage(req *a2apb.SendMessageRequest, stream grpc.ServerStreamingServer[a2apb.StreamResponse]) error
func (*Handler) TaskSubscription ¶
func (h *Handler) TaskSubscription(req *a2apb.TaskSubscriptionRequest, stream grpc.ServerStreamingServer[a2apb.StreamResponse]) error
Click to show internal directories.
Click to hide internal directories.