data

package
v0.0.68 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AsyncQueryName = "async-query"

Variables

This section is empty.

Functions

func GqlContext

func GqlContext(ctx goals.GoalEvaluationContext) map[string]interface{}

Types

type AsyncDataSource

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

func NewAsyncDataSource

func NewAsyncDataSource(
	multipleQuerySupport bool,
	req skill.RequestContext,
	evaluationMetadata goals.EvaluationMetadata,
	asyncResults map[string]AsyncQueryResponse,
) AsyncDataSource

func (AsyncDataSource) Query

func (ds AsyncDataSource) Query(ctx context.Context, queryName string, query string, variables map[string]interface{}, output interface{}) (*QueryResponse, error)

type AsyncGraphQLQueryBody added in v0.0.62

type AsyncGraphQLQueryBody struct {
	Query     string                      `edn:"query"`
	Variables map[edn.Keyword]interface{} `edn:"variables"`
	BasisT    *int64                      `edn:"basis-t,omitempty"`
}

type AsyncQueryRequest

type AsyncQueryRequest struct {
	Name     string                `edn:"name"`
	Body     AsyncGraphQLQueryBody `edn:"body"`
	Metadata string                `edn:"metadata"`
}

type AsyncQueryResponse

type AsyncQueryResponse struct {
	Data   edn.RawMessage `edn:"data"`
	Errors []struct {
		Message string `edn:"message"`
	}
}

type AsyncResultMetadata

type AsyncResultMetadata struct {
	EvaluationMetadata goals.EvaluationMetadata      `edn:"evalMeta"`
	AsyncQueryResults  map[string]AsyncQueryResponse `edn:"results"`
	InFlightQueryName  string                        `edn:"query-name"`
}

type ChainDataSource

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

ChainDataSource is a wrapper DataSource that takes a list of other DataSources and returns query results from the first applicable downstream source

func NewChainDataSource

func NewChainDataSource(links ...DataSource) *ChainDataSource

func (ChainDataSource) Query

func (ds ChainDataSource) Query(ctx context.Context, queryName string, query string, variables map[string]interface{}, output interface{}) (*QueryResponse, error)

type DataSource

type DataSource interface {
	Query(ctx context.Context, queryName string, query string, variables map[string]interface{}, output interface{}) (*QueryResponse, error)
}

type FixedDataSource

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

FixedDataSource returns static data from responses passed in at construction time

func NewFixedDataSource

func NewFixedDataSource(unmarshaler FixedDataSourceUnmarshaler, data map[string][]byte) FixedDataSource

func (FixedDataSource) Query

func (ds FixedDataSource) Query(ctx context.Context, queryName string, query string, variables map[string]interface{}, output interface{}) (*QueryResponse, error)

type FixedDataSourceUnmarshaler

type FixedDataSourceUnmarshaler func(data []byte, output interface{}) error

type QueryResponse

type QueryResponse struct {
	AsyncRequestMade bool
}

type SyncGraphQLQueryBody added in v0.0.62

type SyncGraphQLQueryBody struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
	BasisT    *int64                 `json:"basis-t,omitempty"`
}

type SyncGraphqlDataSource

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

func NewSyncGraphqlDataSource

func NewSyncGraphqlDataSource(ctx context.Context, token string, url string, logger skill.Logger) SyncGraphqlDataSource

func NewSyncGraphqlDataSourceFromSkillRequest added in v0.0.48

func NewSyncGraphqlDataSourceFromSkillRequest(ctx context.Context, req skill.RequestContext, evalMeta goals.EvaluationMetadata) SyncGraphqlDataSource

func (SyncGraphqlDataSource) Query

func (ds SyncGraphqlDataSource) Query(ctx context.Context, queryName string, query string, variables map[string]interface{}, output interface{}) (*QueryResponse, error)

func (SyncGraphqlDataSource) WithBasisT added in v0.0.58

func (ds SyncGraphqlDataSource) WithBasisT(basisT int64) SyncGraphqlDataSource

func (SyncGraphqlDataSource) WithCorrelationId added in v0.0.58

func (ds SyncGraphqlDataSource) WithCorrelationId(correlationId string) SyncGraphqlDataSource

func (SyncGraphqlDataSource) WithQueryCache added in v0.0.63

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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