Documentation ¶
Overview ¶
Package ndgo <read iNDiGO> provides dgo abstractions and helper func's - github.com/ppp225/ndgo
Index ¶
- func Flatten(toFlatten interface{}) (result interface{})
- type DeleteJSON
- type Query
- func (Query) DeleteEdge(from, predicate, to string) DeleteJSON
- func (Query) DeleteNode(uid string) DeleteJSON
- func (Query) GetPredExpandAll(queryID, pred, val string) QueryJSON
- func (Query) GetPredExpandAllLevel2(queryID, pred, val string) QueryJSON
- func (Query) GetPredUID(queryID, pred, val string) QueryJSON
- func (Query) GetUIDExpandAll(queryID, uid string) QueryJSON
- func (Query) HasPredExpandAll(queryID, pred string) QueryJSON
- type QueryJSON
- type SetJSON
- type Txn
- func (v *Txn) Commit() (err error)
- func (v *Txn) Delete(json string) (resp *api.Assigned, err error)
- func (v *Txn) Deleteb(json []byte) (resp *api.Assigned, err error)
- func (v *Txn) Discard()
- func (v *Txn) GetDatabaseTime() float64
- func (v *Txn) GetNetworkTime() float64
- func (v *Txn) Mutate(mu *api.Mutation) (resp *api.Assigned, err error)
- func (v *Txn) Query(q string) (resp *api.Response, err error)
- func (v *Txn) QueryWithVars(q string, vars map[string]string) (resp *api.Response, err error)
- func (v *Txn) Set(json string) (resp *api.Assigned, err error)
- func (v *Txn) Setb(json []byte) (resp *api.Assigned, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeleteJSON ¶
type DeleteJSON string
DeleteJSON represents a dgraph delete mutation string with some methods defined
func (DeleteJSON) Join ¶
func (v DeleteJSON) Join(json DeleteJSON) DeleteJSON
Join allows to join multiple json Query of same type
type Query ¶
type Query struct{}
Query groups
func (Query) DeleteEdge ¶
func (Query) DeleteEdge(from, predicate, to string) DeleteJSON
DeleteEdge Usage: _, err = ndgo.Query{}.DeleteEdge(parentUID, "edgeName", childUID).Run(txn)
func (Query) DeleteNode ¶
func (Query) DeleteNode(uid string) DeleteJSON
DeleteNode Usage: _, err = ndgo.Query{}.DeleteNode(UID).Run(txn)
func (Query) GetPredExpandAll ¶
GetPredExpandAll Usage: ndgo.Query{}.GetPredExpandAll("q1", "userName", decode.Name).Run(txn)
func (Query) GetPredExpandAllLevel2 ¶
GetPredExpandAllLevel2 expands subnodes as well Usage: ndgo.Query{}.GetPredExpandAll("q1", "userName", decode.Name).Run(txn)
func (Query) GetPredUID ¶
GetPredUID Usage: Query{}.GetPredUID("q1", "userID", decode.UserID).Run(txn)
func (Query) GetUIDExpandAll ¶
GetUIDExpandAll Usage: ndgo.Query{}.GetUIDExpandAll("q", assigned.Uids["blank-0"]).Run(txn)
func (Query) HasPredExpandAll ¶
HasPredExpandAll Usage: Query{}.HasPredExpandAll("q1", "userID", decode.UserID).Run(txn)
type QueryJSON ¶
type QueryJSON string
QueryJSON represents a dgraph query string with some methods defined
type SetJSON ¶
type SetJSON string
SetJSON represents a dgraph set mutation string with some methods defined
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
Txn is a dgo.Txn wrapper with additional diagnostic data Helps with Queries, by providing abstractions for dgraph Query and Mutation
func NewTxnWithContext ¶
NewTxnWithContext creates new Txn (with ctx)
func (*Txn) Discard ¶
func (v *Txn) Discard()
Discard cleans up dgo.Txn resources. Always defer this on creation.
func (*Txn) GetDatabaseTime ¶
GetDatabaseTime gets time txn spend in db
func (*Txn) GetNetworkTime ¶
GetNetworkTime gets total time until response
func (*Txn) QueryWithVars ¶
QueryWithVars performs dgraph query with vars