jsonrpc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package jsonrpc provides JSON RPC utilities for serialization of AWS requests and responses.

Index

Constants

This section is empty.

Variables

View Source
var BuildHandler = request.NamedHandler{
	Name: "awssdk.jsonrpc.Build",
	Fn:   Build,
}

BuildHandler is a named request handler for building jsonrpc protocol requests

View Source
var UnmarshalErrorHandler = request.NamedHandler{
	Name: "awssdk.jsonrpc.UnmarshalError",
	Fn:   UnmarshalError,
}

UnmarshalErrorHandler is a named request handler for unmarshaling jsonrpc protocol request errors

View Source
var UnmarshalHandler = request.NamedHandler{
	Name: "awssdk.jsonrpc.Unmarshal",
	Fn:   Unmarshal,
}

UnmarshalHandler is a named request handler for unmarshaling jsonrpc protocol requests

View Source
var UnmarshalMetaHandler = request.NamedHandler{
	Name: "awssdk.jsonrpc.UnmarshalMeta",
	Fn:   UnmarshalMeta,
}

UnmarshalMetaHandler is a named request handler for unmarshaling jsonrpc protocol request metadata

Functions

func Build

func Build(req *request.Request)

Build builds a JSON payload for a JSON RPC request.

func Unmarshal

func Unmarshal(req *request.Request)

Unmarshal unmarshals a response for a JSON RPC service.

func UnmarshalError

func UnmarshalError(req *request.Request)

UnmarshalError unmarshals an error response for a JSON RPC service.

func UnmarshalMeta

func UnmarshalMeta(req *request.Request)

UnmarshalMeta unmarshals headers from a response for a JSON RPC service.

func WithQueryCompatibility

func WithQueryCompatibility(queryExceptions map[string]func(protocol.ResponseMetadata, string) error) func(*UnmarshalTypedError)

WithQueryCompatibility is a helper function to construct a functional option for use with NewUnmarshalTypedErrorWithOptions. The queryExceptions given act as an override for unmarshalling errors when query compatible error codes are found. See also awsQueryCompatible trait

Types

type UnmarshalTypedError

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

UnmarshalTypedError provides unmarshaling errors API response errors for both typed and untyped errors.

func NewUnmarshalTypedError

func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError

NewUnmarshalTypedError returns an UnmarshalTypedError initialized for the set of exception names to the error unmarshalers

func NewUnmarshalTypedErrorWithOptions

func NewUnmarshalTypedErrorWithOptions(exceptions map[string]func(protocol.ResponseMetadata) error, optFns ...func(*UnmarshalTypedError)) *UnmarshalTypedError

NewUnmarshalTypedErrorWithOptions works similar to NewUnmarshalTypedError applying options to the UnmarshalTypedError before returning it

func (*UnmarshalTypedError) UnmarshalError

func (u *UnmarshalTypedError) UnmarshalError(
	resp *http.Response,
	respMeta protocol.ResponseMetadata,
) (error, error)

UnmarshalError attempts to unmarshal the HTTP response error as a known error type. If unable to unmarshal the error type, the generic SDK error type will be used.

Jump to

Keyboard shortcuts

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