Documentation
¶
Index ¶
- type ExecutionResultCodec
- func (erc *ExecutionResultCodec) ArgoToOrderedMap(argoBytes *buf.Buf) (*orderedmap.OrderedMap[string, interface{}], error)
- func (erc *ExecutionResultCodec) OrderedMapToArgo(om *orderedmap.OrderedMap[string, interface{}]) (*buf.Buf, error)
- func (erc *ExecutionResultCodec) OrderedMapToArgoWithEncoder(om *orderedmap.OrderedMap[string, interface{}], encoder *codec.ArgoEncoder) (*buf.Buf, error)
- func (erc *ExecutionResultCodec) Typer() *typer.Typer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionResultCodec ¶
type ExecutionResultCodec struct {
// contains filtered or unexported fields
}
ExecutionResultCodec is the primary entry point for encoding and decoding GraphQL ExecutionResult objects to and from the Argo binary format. It utilizes a GraphQL schema and query document to determine the wire types for encoding and decoding data, managed by an internal Typer instance.
func NewExecutionResultCodec ¶
func NewExecutionResultCodec(schema *ast.Schema, query *ast.QueryDocument, operationName ...string) (*ExecutionResultCodec, error)
NewExecutionResultCodec creates a new ExecutionResultCodec. It requires a GraphQL schema and a query document. An optional operationName can be provided to specify which operation in the query document to use; if not provided, the Typer will attempt to select a default operation. Returns an error if the Typer cannot be initialized (e.g., due to an invalid schema, query, or operation name).
func (*ExecutionResultCodec) ArgoToOrderedMap ¶
func (erc *ExecutionResultCodec) ArgoToOrderedMap(argoBytes *buf.Buf) (*orderedmap.OrderedMap[string, interface{}], error)
ArgoToOrderedMap converts Argo-encoded bytes from a buf.Buf into an orderedmap.OrderedMap. This OrderedMap represents a GraphQL ExecutionResult (typically containing "data", "errors", "extensions" keys). The method relies on the underlying ArgoDecoder to correctly parse the Argo bytes according to the schema and query associated with this ExecutionResultCodec.
func (*ExecutionResultCodec) OrderedMapToArgo ¶
func (erc *ExecutionResultCodec) OrderedMapToArgo(om *orderedmap.OrderedMap[string, interface{}]) (*buf.Buf, error)
OrderedMapToArgo converts an orderedmap.OrderedMap (representing a GraphQL ExecutionResult) into Argo-encoded bytes contained in a buf.Buf. The `om` parameter holds the GraphQL execution result (data, errors, extensions). This method uses a default ArgoEncoder.
func (*ExecutionResultCodec) OrderedMapToArgoWithEncoder ¶
func (erc *ExecutionResultCodec) OrderedMapToArgoWithEncoder(om *orderedmap.OrderedMap[string, interface{}], encoder *codec.ArgoEncoder) (*buf.Buf, error)
OrderedMapToArgoWithEncoder converts an orderedmap.OrderedMap (representing a GraphQL ExecutionResult) into Argo-encoded bytes using a provided ArgoEncoder. This allows for customization of the encoding process, such as setting specific header flags. The `om` parameter holds the GraphQL execution result. The encoder is responsible for deterministic serialization of the map contents.
func (*ExecutionResultCodec) Typer ¶
func (erc *ExecutionResultCodec) Typer() *typer.Typer
Typer returns the Typer instance used by this ExecutionResultCodec. The Typer is responsible for determining the Argo wire types based on the GraphQL schema and query.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package block provides reader and writer types for processing Argo data blocks.
|
Package block provides reader and writer types for processing Argo data blocks. |
|
Package codec provides the tools for encoding and decoding Argo data.
|
Package codec provides the tools for encoding and decoding Argo data. |
|
internal
|
|
|
testutils
Package testutils provides utility functions for testing Argo functionality.
|
Package testutils provides utility functions for testing Argo functionality. |
|
util
Package util provides miscellaneous utility functions used across the argo-go library.
|
Package util provides miscellaneous utility functions used across the argo-go library. |
|
Package label defines the Label type and its associated operations for Argo.
|
Package label defines the Label type and its associated operations for Argo. |
|
pkg
|
|
|
bitset
Package bitset provides a BitSet data structure backed by *big.Int, along with helpers for reading and writing bitsets in variable-length (self-delimiting) and fixed-length formats.
|
Package bitset provides a BitSet data structure backed by *big.Int, along with helpers for reading and writing bitsets in variable-length (self-delimiting) and fixed-length formats. |
|
directives
Package directives defines and provides helpers for Argo-specific GraphQL directives used to control serialization, deserialization, and other behaviors.
|
Package directives defines and provides helpers for Argo-specific GraphQL directives used to control serialization, deserialization, and other behaviors. |
|
varint
Package varint implements ULEB128 (Unsigned Little Endian Base 128) and ZigZag encoding/decoding for arbitrary-precision integers (*big.Int) and standard integer types (uint64, int64).
|
Package varint implements ULEB128 (Unsigned Little Endian Base 128) and ZigZag encoding/decoding for arbitrary-precision integers (*big.Int) and standard integer types (uint64, int64). |
|
Package typer is responsible for converting GraphQL schema types and query selections into Argo wire types.
|
Package typer is responsible for converting GraphQL schema types and query selections into Argo wire types. |
|
Package wire defines the fundamental Argo wire types, such as String, Varint, Record, Array, etc., and provides utilities for working with these types.
|
Package wire defines the fundamental Argo wire types, such as String, Varint, Record, Array, etc., and provides utilities for working with these types. |