Documentation ¶
Index ¶
- Variables
- func ProcessGraph(ctx context.Context, sg, parent *SubGraph, rch chan error)
- func ShortestPath(ctx context.Context, sg *SubGraph) error
- func ToJson(l *Latency, sgl []*SubGraph, w io.Writer, allocIds map[string]string) error
- func ToProtocolBuf(l *Latency, sgl []*SubGraph) ([]*graph.Node, error)
- type Codec
- type Item
- type Latency
- type SubGraph
Constants ¶
This section is empty.
Variables ¶
var (
ErrEmptyVal = errors.New("query: harmless error, e.g. task.Val is nil")
)
var ErrFacet = x.Errorf("Skip the edge")
var ErrStop = x.Errorf("STOP")
var ErrTooBig = x.Errorf("Query exceeded memory limit")
Functions ¶
func ProcessGraph ¶
ProcessGraph processes the SubGraph instance accumulating result for the query from different instances. Note: taskQuery is nil for root node.
Types ¶
type Codec ¶ added in v0.4.3
type Codec struct{}
Codec implements the custom codec interface.
type Latency ¶
type Latency struct { Start time.Time `json:"-"` Parsing time.Duration `json:"query_parsing"` Processing time.Duration `json:"processing"` Json time.Duration `json:"json_conversion"` ProtocolBuffer time.Duration `json:"pb_conversion"` }
Latency is used to keep track of the latency involved in parsing and processing the query. It also contains information about the time it took to convert the result into a format(JSON/Protocol Buffer) that the client expects.
type SubGraph ¶
type SubGraph struct { Attr string Params params // SrcUIDs is a list of unique source UIDs. They are always copies of destUIDs // of parent nodes in GraphQL structure. SrcUIDs *task.List SrcFunc []string FilterOp string Filters []*SubGraph Children []*SubGraph // destUIDs is a list of destination UIDs, after applying filters, pagination. DestUIDs *task.List // contains filtered or unexported fields }
SubGraph is the way to represent data internally. It contains both the query and the response. Once generated, this can then be encoded to other client convenient formats, like GraphQL / JSON.
func ProcessQuery ¶ added in v0.7.2
func ToSubGraph ¶
ToSubGraph converts the GraphQuery into the internal SubGraph instance type.
func (*SubGraph) DebugPrint ¶ added in v0.7.0
DebugPrint prints out the SubGraph tree in a nice format for debugging purposes.