jsonrpc

package
v0.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = "2.0"

	// HTTP headers
	ContentJSON = "application/json"

	// JSON-RPC method names per A2A spec §7
	MethodMessageSend          = "message/send"
	MethodMessageStream        = "message/stream"
	MethodTasksGet             = "tasks/get"
	MethodTasksCancel          = "tasks/cancel"
	MethodTasksResubscribe     = "tasks/resubscribe"
	MethodPushConfigGet        = "tasks/pushNotificationConfig/get"
	MethodPushConfigSet        = "tasks/pushNotificationConfig/set"
	MethodPushConfigList       = "tasks/pushNotificationConfig/list"
	MethodPushConfigDelete     = "tasks/pushNotificationConfig/delete"
	MethodGetExtendedAgentCard = "agent/getAuthenticatedExtendedCard"
)

JSON-RPC 2.0 protocol constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int            `json:"code"`
	Message string         `json:"message"`
	Data    map[string]any `json:"data,omitempty"`
}

jsonrpcError represents a JSON-RPC 2.0 error object. TODO(yarolegovich): Convert to transport-agnostic error format so Client can use errors.Is(err, a2a.ErrMethodNotFound). This needs to be implemented across all transports (currently not in grpc either).

func ToJSONRPCError

func ToJSONRPCError(err error) *Error

func (*Error) Error

func (e *Error) Error() string

Error implements the error interface for jsonrpcError.

func (*Error) ToA2AError

func (e *Error) ToA2AError() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL