n3gql

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 15 Imported by: 1

README

n3-gql

graphql sub-system for data querying

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeErrors

func MergeErrors(cs ...<-chan error) <-chan error

MergeErrors merges multiple channels of errors. Based on https://blog.golang.org/pipelines.

func WaitForPipeline

func WaitForPipeline(errs ...<-chan error) error

WaitForPipeline waits for results from all error channels. It returns early on the first error.

Types

type GQLManager

type GQLManager struct {
	sync.Mutex
	Schema      SchemaData
	UserId      string
	ContextName string
	// contains filtered or unexported fields
}

func NewGQLManager

func NewGQLManager(userid, contextName string, db *deep6.Deep6DB) *GQLManager

func (*GQLManager) BuildSchemaFromJSONChannel

func (gqm *GQLManager) BuildSchemaFromJSONChannel(iterator <-chan []byte) error

connects the schema builder to a channel providing json objects (typically the feed from the crdt manager) received objects will then be translated into gqphql-schema and fed to executor that will handle queries.

func (*GQLManager) Close

func (gqm *GQLManager) Close() error

shut the schema-builder down gracefully, save schema for next restart of service.

func (*GQLManager) Query

func (gqm *GQLManager) Query(query string, variables map[string]interface{}) (map[string]interface{}, error)

handler for gql requests

type SchemaData

type SchemaData struct {
	RawData      []byte
	ClassifiedAs string
	DataModel    string
	Types        map[string]map[string]string
	Queries      map[string]string
}

data package passed between stages of the schema-builder pipeline

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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