jsonrpc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package jsonrpc propagates correlation through an explicit JSON-RPC metadata object. It never edits JSON-RPC protocol envelopes implicitly.

Index

Constants

View Source
const (
	// CorrelationField carries the logical workflow identifier.
	CorrelationField = correlation.DefaultCorrelationField
	// RequestField carries the current JSON-RPC hop identifier.
	RequestField = correlation.DefaultRequestField
	// CausationField carries the immediate parent identifier.
	CausationField = correlation.DefaultCausationField
)

Variables

View Source
var (
	// ErrInvalidOptions reports incomplete adapter configuration.
	ErrInvalidOptions = errors.New("jsonrpc correlation: invalid options")
	// ErrMalformedMetadata reports non-string or oversized JSON metadata.
	ErrMalformedMetadata = errors.New("jsonrpc correlation: malformed metadata")
)

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter explicitly sends and receives JSON-RPC metadata.

func New

func New(factory *correlation.Factory, options Options) (*Adapter, error)

New constructs a JSON-RPC metadata adapter.

func (*Adapter) Receive

func (adapter *Adapter) Receive(metadata Metadata, trusted bool) (correlation.Values, error)

Receive validates metadata and creates a fresh receiving request ID.

func (*Adapter) Send

func (adapter *Adapter) Send(metadata Metadata, parent correlation.Values) (correlation.Values, error)

Send creates and injects a child JSON-RPC metadata hop.

type Metadata

type Metadata map[string][]json.RawMessage

Metadata preserves repeated JSON members supplied by a strict envelope decoder so conflicting duplicates cannot be silently collapsed.

type Options

type Options struct {
	Codec correlation.CodecOptions
}

Options configure JSON-RPC metadata validation and names.

Jump to

Keyboard shortcuts

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