api

package
v0.0.0-...-049676f Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultQueryEnginePool

func DefaultQueryEnginePool() sync.Pool

func MakeGraphQL

func MakeGraphQL(
	keyring *auth.Keyring,
	endpoint string,
	scheduler scheduler,
) *gql

func NewScheduler

func NewScheduler(storage redis.Cmdable) scheduler

Types

type QueryEngine

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

* The Query Engine struct, which mostly just manages a pool of Session objects * that wrap C++ functionality and gives it a go interface.

func (*QueryEngine) Get

func (qe *QueryEngine) Get() *QuerySession

func (*QueryEngine) Put

func (qe *QueryEngine) Put(q *QuerySession)

type QueryPlan

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

type QuerySession

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

* A QuerySession wraps C++ functionality and caches parsed messages, re-uses * buffers etc.

func NewQuerySession

func NewQuerySession() *QuerySession

func (*QuerySession) InitWithManifest

func (q *QuerySession) InitWithManifest(doc []byte) error

func (*QuerySession) PlanQuery

func (q *QuerySession) PlanQuery(query *message.Query) (*QueryPlan, error)

func (*QuerySession) QueryManifest

func (q *QuerySession) QueryManifest(path string) (json.RawMessage, error)

* QueryManifest is essentially a JSON pointer [1] interface to the manifest * object. It is intended to support simple read-field-in-manifest resolvers, * without having to parse the manifest every time. * * It is written through cgo and the query engine in order to make go a pure * I/O layer, and to contain all parsing, validation, and lookup in the same * module. This means certain classes of errors can be handled centrally too, * rather than having to take up space in every single block * * This does make a single query lookup *significantly* more complicated than * it would be in pure go, but it makes adding new calls very cheap, and it * makes for a single feature that must be understood. * * This function returns a JSON encoded byte array (if not an error). Ideally * graphql could just write this directly, but the resolver system expects to * find a return type of the resolver that matches the schema type. An easy fix * is to parse the RawMessage into the "destination" type. The overhead is of * course outrageous, but it can work until the upstream graphql support can * handle json.rawmessage or similar. * * Key misses return an empty document. * * [1] https://rapidjson.org/md_doc_pointer.html

type Result

type Result struct {
	Timeout    time.Duration
	StorageURL string
	Storage    redis.Cmdable
	Keyring    *auth.Keyring
}

func (*Result) Get

func (r *Result) Get(ctx *gin.Context)

func (*Result) Status

func (r *Result) Status(ctx *gin.Context)

func (*Result) Stream

func (r *Result) Stream(ctx *gin.Context)

Jump to

Keyboard shortcuts

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