Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultQueryEnginePool ¶
func MakeGraphQL ¶
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 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