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) 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.
Click to show internal directories.
Click to hide internal directories.