Documentation
¶
Index ¶
- Constants
- func FormatterForRelayRequestAndResponse(apiInterface string) (inputFormatter func([]byte) []byte, outputFormatter func([]byte) []byte)
- func FormatterForRelayRequestAndResponseJsonRPC() (inputFormatter func([]byte) []byte, outputFormatter func([]byte) []byte)
- func IdentityFormatter() (inputFormatter func([]byte) []byte, outputFormatter func([]byte) []byte)
Constants ¶
const ( IDFieldName = "id" DefaultIDValue = 1 )
Variables ¶
This section is empty.
Functions ¶
func FormatterForRelayRequestAndResponse ¶
func FormatterForRelayRequestAndResponse(apiInterface string) (inputFormatter func([]byte) []byte, outputFormatter func([]byte) []byte)
FormatterForRelayRequestAndResponse returns input and output formatter functions for the given apiInterface. The input formatter normalizes the request for cache key generation (e.g. strips the JSON-RPC id field). The output formatter restores the original id in the response.
func FormatterForRelayRequestAndResponseJsonRPC ¶
func FormatterForRelayRequestAndResponseJsonRPC() (inputFormatter func([]byte) []byte, outputFormatter func([]byte) []byte)
FormatterForRelayRequestAndResponseJsonRPC returns formatters that remove the JSON-RPC id from requests (so cache keys are id-independent) and restore the original id in responses.
Types ¶
This section is empty.