dgraph

package
v0.0.0-...-ce25bc5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteNode

func DeleteNode(ctx context.Context, tx *dgo.Txn, id string) (*api.Response, error)

func Dial

func Dial(network, address string, timeout time.Duration) (net.Conn, error)

Dial to gRPC service. It is used in health checks

func Discard

func Discard(ctx context.Context, txn *dgo.Txn)

func InitSchema

func InitSchema()

func IsUID

func IsUID(s string) bool

func Mutate

func Mutate(ctx context.Context, tx *dgo.Txn, m Mutation) ([]map[string]interface{}, error)

func NewClient

func NewClient(ctx context.Context) (*dgo.Dgraph, context.CancelFunc, error)

NewClient creates new dgraph client

func NewRestClient

func NewRestClient() *rest.Client

func NodeLabel

func NodeLabel(resourceType string) string

func ReadNode

func ReadNode(ctx context.Context, tx *dgo.Txn, id string) (map[string]interface{}, error)

func ReadNodeTx

func ReadNodeTx(ctx context.Context, id string) (map[string]interface{}, error)

func RequestTransaction

func RequestTransaction(r *http.Request) *dgo.Txn

func TransactionMiddleware

func TransactionMiddleware(next http.Handler) http.Handler

func WithAuthToken

func WithAuthToken(ctx context.Context) context.Context

Types

type ListResult

type ListResult struct {
	Items []map[string]interface{} `json:"items"`
	Total int64                    `json:"total"`
}

func ReadList

func ReadList(ctx context.Context, tx *dgo.Txn, label string, pg pagination.Pagination) (*ListResult, error)

type Mutation

type Mutation struct {
	Input     orderedjson.Map
	NodeLabel string
	ID        string
	By        string
	NoCommit  bool
}

Jump to

Keyboard shortcuts

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