Documentation ¶
Index ¶
- type HTTPConnector
- func (c *HTTPConnector) ApplyNDCHttpSchemas(ctx context.Context, config *configuration.Configuration, ...) error
- func (c *HTTPConnector) GetCapabilities(configuration *configuration.Configuration) schema.CapabilitiesResponseMarshaler
- func (c *HTTPConnector) GetSchema(ctx context.Context, configuration *configuration.Configuration, _ *State) (schema.SchemaResponseMarshaler, error)
- func (c *HTTPConnector) HealthCheck(ctx context.Context, configuration *configuration.Configuration, state *State) error
- func (c *HTTPConnector) Mutation(ctx context.Context, configuration *configuration.Configuration, state *State, ...) (*schema.MutationResponse, error)
- func (c *HTTPConnector) MutationExplain(ctx context.Context, configuration *configuration.Configuration, state *State, ...) (*schema.ExplainResponse, error)
- func (c *HTTPConnector) ParseConfiguration(ctx context.Context, configurationDir string) (*configuration.Configuration, error)
- func (c *HTTPConnector) Query(ctx context.Context, configuration *configuration.Configuration, state *State, ...) (schema.QueryResponse, error)
- func (c *HTTPConnector) QueryExplain(ctx context.Context, configuration *configuration.Configuration, state *State, ...) (*schema.ExplainResponse, error)
- func (c *HTTPConnector) TryInitState(ctx context.Context, configuration *configuration.Configuration, ...) (*State, error)
- type Option
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPConnector ¶
type HTTPConnector struct {
// contains filtered or unexported fields
}
HTTPConnector implements the SDK interface of NDC specification
func NewHTTPConnector ¶
func NewHTTPConnector(opts ...Option) *HTTPConnector
NewHTTPConnector creates a HTTP connector instance
func (*HTTPConnector) ApplyNDCHttpSchemas ¶
func (c *HTTPConnector) ApplyNDCHttpSchemas(ctx context.Context, config *configuration.Configuration, schemas []configuration.NDCHttpRuntimeSchema, logger *slog.Logger) error
ApplyNDCHttpSchemas applies slice of raw NDC HTTP schemas to the connector
func (*HTTPConnector) GetCapabilities ¶
func (c *HTTPConnector) GetCapabilities(configuration *configuration.Configuration) schema.CapabilitiesResponseMarshaler
GetCapabilities get the connector's capabilities.
func (*HTTPConnector) GetSchema ¶
func (c *HTTPConnector) GetSchema(ctx context.Context, configuration *configuration.Configuration, _ *State) (schema.SchemaResponseMarshaler, error)
GetSchema gets the connector's schema.
func (*HTTPConnector) HealthCheck ¶
func (c *HTTPConnector) HealthCheck(ctx context.Context, configuration *configuration.Configuration, state *State) error
HealthCheck checks the health of the connector.
For example, this function should check that the connector is able to reach its data source over the network.
Should throw if the check fails, else resolve.
func (*HTTPConnector) Mutation ¶
func (c *HTTPConnector) Mutation(ctx context.Context, configuration *configuration.Configuration, state *State, request *schema.MutationRequest) (*schema.MutationResponse, error)
Mutation executes a mutation.
func (*HTTPConnector) MutationExplain ¶
func (c *HTTPConnector) MutationExplain(ctx context.Context, configuration *configuration.Configuration, state *State, request *schema.MutationRequest) (*schema.ExplainResponse, error)
MutationExplain explains a mutation by creating an execution plan.
func (*HTTPConnector) ParseConfiguration ¶
func (c *HTTPConnector) ParseConfiguration(ctx context.Context, configurationDir string) (*configuration.Configuration, error)
ParseConfiguration validates the configuration files provided by the user, returning a validated 'Configuration', or throwing an error to prevents Connector startup.
func (*HTTPConnector) Query ¶
func (c *HTTPConnector) Query(ctx context.Context, configuration *configuration.Configuration, state *State, request *schema.QueryRequest) (schema.QueryResponse, error)
Query executes a query.
func (*HTTPConnector) QueryExplain ¶
func (c *HTTPConnector) QueryExplain(ctx context.Context, configuration *configuration.Configuration, state *State, request *schema.QueryRequest) (*schema.ExplainResponse, error)
QueryExplain explains a query by creating an execution plan.
func (*HTTPConnector) TryInitState ¶
func (c *HTTPConnector) TryInitState(ctx context.Context, configuration *configuration.Configuration, metrics *connector.TelemetryState) (*State, error)
TryInitState initializes the connector's in-memory state.
For example, any connection pools, prepared queries, or other managed resources would be allocated here.
In addition, this function should register any connector-specific metrics with the metrics registry.
type Option ¶
type Option (func(*options))
Option is an interface to set custom HTTP connector options
func WithClient ¶
WithClient sets the custom HTTP client that satisfy the Doer interface