connector

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugJSONAttributes

func DebugJSONAttributes(data map[string]any, isDebug bool) []attribute.KeyValue

DebugJSONAttributes create OpenTelemetry attributes with JSON data. They are only visible on debug mode

func GetConfiguration

func GetConfiguration(configurationDir string, configFileName string) (*types.Configuration, error)

GetConfiguration reads the configuration file, parses it into a Configuration struct, and initializes the native queries.

func GetFieldType added in v1.0.3

func GetFieldType(fieldMap map[string]interface{}, state *types.State, indexName string, fieldName string) string

`GetFieldType` returns the type of the field. It also handles fields with subtypes It also handles the check for whether a given fields' type supports comparison and aggregation operations

For scalar fields that have no subtypes, their types are returned after checks for comparison and aggregation operations

For fields that have subtypes, the types are sorted by priority and then the comparison and aggregation operations are checked for each subtype A compound scalar type is generated for these types. The compound scalar type has the format `actualFieldType.subtype1.subtype2...` This compound scalar type supports a superset of comparison and aggregation operations of all its subtypes and the actualType This compund scalar type is added to the scalarTypeMap before being returned

func JSONAttribute

func JSONAttribute(key string, data any) attribute.KeyValue

JSONAttribute creates a OpenTelemetry attribute with JSON data

func ParseConfigurationToSchema added in v1.0.3

func ParseConfigurationToSchema(configuration *types.Configuration, state *types.State) *schema.SchemaResponse

parseConfigurationToSchema parses the given configuration to generate the schema response.

Types

type Connector

type Connector struct{}

Connector implements the SDK interface of NDC specification

func (*Connector) GetCapabilities

func (c *Connector) GetCapabilities(configuration *types.Configuration) schema.CapabilitiesResponseMarshaler

GetCapabilities get the connector's capabilities.

func (*Connector) GetSchema

func (c *Connector) GetSchema(ctx context.Context, configuration *types.Configuration, state *types.State) (schema.SchemaResponseMarshaler, error)

GetSchema returns the schema by parsing the configuration.

func (*Connector) HealthCheck

func (c *Connector) HealthCheck(ctx context.Context, configuration *types.Configuration, state *types.State) error

HealthCheck checks the health of the connector.

func (*Connector) Mutation

func (c *Connector) Mutation(ctx context.Context, configuration *types.Configuration, state *types.State, request *schema.MutationRequest) (*schema.MutationResponse, error)

Mutation executes a mutation request.

func (*Connector) MutationExplain

func (c *Connector) MutationExplain(ctx context.Context, configuration *types.Configuration, state *types.State, request *schema.MutationRequest) (*schema.ExplainResponse, error)

MutationExplain explains a mutation by creating an execution plan.

func (*Connector) ParseConfiguration

func (c *Connector) ParseConfiguration(ctx context.Context, configurationDir string) (*types.Configuration, error)

ParseConfiguration parses the connector's configuration.

func (*Connector) Query

func (c *Connector) Query(ctx context.Context, configuration *types.Configuration, state *types.State, request *schema.QueryRequest) (schema.QueryResponse, error)

Query executes a query request.

func (*Connector) QueryExplain

func (c *Connector) QueryExplain(ctx context.Context, configuration *types.Configuration, state *types.State, request *schema.QueryRequest) (*schema.ExplainResponse, error)

QueryExplain explains a query by creating an execution plan.

func (*Connector) TryInitState

func (c *Connector) TryInitState(ctx context.Context, configuration *types.Configuration, metrics *connector.TelemetryState) (*types.State, error)

TryInitState initializes the connector's in-memory state.

Jump to

Keyboard shortcuts

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