dgraph

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATE = "create"
	UPDATE = "update"
	DELETE = "delete"
)

mutation types

Variables

This section is empty.

Functions

func Close

func Close()

Close terminates the Dgraph connection

func CreateSchema

func CreateSchema() error

CreateSchema sets the Dgraph schema

func ExecuteQuery

func ExecuteQuery(query string, root interface{}) error

ExecuteQuery given a query and it fetches and writes result into interface

func ExecuteQueryRaw

func ExecuteQueryRaw(query string) ([]byte, error)

ExecuteQueryRaw given a query and it fetches and writes result into interface

func GetUID

func GetUID(id string, nodeType string) string

GetUID returns the UID of the node in the Dgraph returns empty string if error has occurred

func MutateNode

func MutateNode(data interface{}, mutateType string) (*api.Assigned, error)

MutateNode mutates a Dgraph transaction

func Open

func Open(url string) error

Open creates and establishes a new Dgraph connection

func RemoveResourcesInactiveInCurrentMonth

func RemoveResourcesInactiveInCurrentMonth()

RemoveResourcesInactiveInCurrentMonth deletes all resources which have their deletion time stamp before the start of current month.

Types

type ID

type ID struct {
	Xid string `json:"xid,omitempty"`
	UID string `json:"uid,omitempty"`
}

ID maps the external ID used in Dgraph to the UID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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