dqrack

package module
v0.0.0-...-154e860 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: MIT Imports: 12 Imported by: 0

README

dqrack

Build Status

WIP Go wrapper around Dgraph to scan/marshal in structs.

docs coming soon

Documentation

Overview

Package dqrack is a helping wrapper for Dgraph. It provides a load of useful "marshalling" functions to allow lazy work.

Pronounced "d-crack"

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyTypeName = errors.New("type name was empty. this kills the batman.")
	ErrNotStruct     = errors.New("data was not a struct")
	ErrEmpty         = errors.New("empty value")
	ErrNil           = errors.New("argument was nil, expected not nil")
)

Functions

This section is empty.

Types

type Dqrack

type Dqrack struct {
	Dgraph *dgraph.Dgraph

	Debug bool
	// contains filtered or unexported fields
}

Dqrack is a set of cheap tricks, like any other cheap trick library.

func New

func New(dg *dgraph.Dgraph) (*Dqrack, error)

func (*Dqrack) ConnectNodes

func (dq *Dqrack) ConnectNodes(v1 Qrackable, pred string, v2 Qrackable) error

func (*Dqrack) Fetch

func (dq *Dqrack) Fetch(v Qrackable, preds []string) (n *protos.Node, err error)

Node fetches a node based on a Qrackable struct. An empty node can be tested for with n.String() == ""

func (*Dqrack) Node

func (dq *Dqrack) Node(v Qrackable) (n Node, err error)

Node fetches a node based on a Qrackable struct. An empty node can be tested for with n.String() == ""

func (*Dqrack) PutNode

func (dq *Dqrack) PutNode(v Qrackable) (n dgraph.Node, err error)

PutNode creates a node with edges from the struct.

func (*Dqrack) Run

func (dq *Dqrack) Run(req *dgraph.Req) (*protos.Response, error)

func (*Dqrack) Scan

func (dq *Dqrack) Scan(identity string, v interface{}) error

type Node

type Node = dgraph.Node

Convenience alias for a dgraph Node

type QDataable

type QDataable interface {
	GetData() interface{}
}

type QTypeable

type QTypeable interface {
	GetType() string
}

type Qrackable

type Qrackable interface {
	GetName() string
}

Qrackable types let us get information out of structs in a non-arbitrary fashion.

Jump to

Keyboard shortcuts

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