query

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2016 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessGraph

func ProcessGraph(ctx context.Context, sg *SubGraph, rch chan error)

Types

type Codec added in v0.4.3

type Codec struct{}

Codec implements the custom codec interface.

func (*Codec) Marshal added in v0.4.3

func (c *Codec) Marshal(v interface{}) ([]byte, error)

Marshal release the graph.Node pointers after marshalling the response.

func (*Codec) String added in v0.4.3

func (c *Codec) String() string

func (*Codec) Unmarshal added in v0.4.3

func (c *Codec) Unmarshal(data []byte, v interface{}) error

Unmarshal constructs graph.Request from the byte slice.

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"`
}

func (*Latency) ToMap

func (l *Latency) ToMap() map[string]string

type ListChannel

type ListChannel struct {
	TList *task.UidList
	Idx   int
}

type SubGraph

type SubGraph struct {
	Attr     string
	Count    int
	Offset   int
	AfterUid uint64
	GetCount uint16
	Children []*SubGraph
	IsRoot   bool
	GetUid   bool

	Query  []byte
	Result []byte
	// 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 ToSubGraph

func ToSubGraph(ctx context.Context, gq *gql.GraphQuery) (*SubGraph, error)

func (*SubGraph) ToJson

func (g *SubGraph) ToJson(l *Latency) (js []byte, rerr error)

func (*SubGraph) ToProtocolBuffer

func (g *SubGraph) ToProtocolBuffer(l *Latency) (n *graph.Node, rerr error)

This method transforms the predicate based subgraph to an predicate-entity based protocol buffer subgraph.

Directories

Path Synopsis
Package graph is a generated protocol buffer package.
Package graph is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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