dgraph

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropAll

func DropAll(dgraph *DGraph) error

func DropPredicate added in v0.0.2

func DropPredicate(ctx context.Context, dg *dgo.Dgraph, predicate string) error

func GetGrpcEndpoint

func GetGrpcEndpoint(dg *DGraph) (string, error)

GetGrpcEndpoint converts a graphql or admin endpoint to a GRPC endpoint, as is commonly specified by the Dgraph Cloud Service

Types

type AdminExport

type AdminExport struct {
	Data  AdminExportPayload `json:"data"`
	Error []GenericError     `json:"errors,omitempty"`
}

AdminExport is a wrapper AdminExportPayload along with details for any errors that might have happened

func AwaitExportBackup

func AwaitExportBackup(dgraph *DGraph, e *AdminExportPromise) (*AdminExport, error)

type AdminExportDataPayload

type AdminExportDataPayload struct {
	Export ExportDataPayload `json:"export"`
}

AdminExportDataPayload is a wrapper for ExportDataPayload

type AdminExportPayload

type AdminExportPayload struct {
	ExportStatus AdminExportStatus `json:"exportStatus"`
}

AdminExportPayload is a wrapper for AdminExportStatus

type AdminExportPromise

type AdminExportPromise struct {
	Data  AdminExportDataPayload `json:"data"`
	Error []GenericError         `json:"errors,omitempty"`
}

AdminExportPromise is a wrapper for AdminExportDataPayload along with details for any errors that might have happened

func ExportBackupQueueJob

func ExportBackupQueueJob(dgraph *DGraph) (*AdminExportPromise, error)

type AdminExportStatus

type AdminExportStatus struct {
	Kind        string    `json:"kind"`
	LastUpdated time.Time `json:"lastUpdated"`
	SignedUrls  []string  `json:"signedUrls"`
	Status      string    `json:"status"`
}

AdminExportStatus provides the response from dgraph which indicates the status of the backup, and URLs over which the backup can be downloaded

type DGraph

type DGraph struct {
	Endpoint string
	ApiToken string
}

DGraph instance definition for providing the endpoint and the Api Token

func FromCliContext

func FromCliContext(cli *cli.Context) *DGraph

FromCliContext creates a dgraph cloud instance from cli.Context

func New

func New(endpoint string, apiKey string) *DGraph

New creates a dgraph cloud instance from provided endpoint and api key

type ExportDataPayload

type ExportDataPayload struct {
	ExportId string `json:"exportId"`
	TaskId   string `json:"taskId"`
}

ExportDataPayload returns the export Id and task Id which can then be used to poll for jobs

type GenericError

type GenericError struct {
	Message string `json:"message"`
}

GenericError is a

type GenericQuery

type GenericQuery struct {
	Query string `json:"query"`
}

GenericQuery helps to send a generic query to dgraph

type PredicateDefinition added in v0.0.2

type PredicateDefinition struct {
	Predicate string `json:"predicate"`
}

type PredicateQuery added in v0.0.2

type PredicateQuery struct {
	Data  PredicateQueryPayload `json:"data"`
	Error []GenericError        `json:"errors,omitempty"`
}

type PredicateQueryPayload added in v0.0.2

type PredicateQueryPayload struct {
	Schema []PredicateDefinition `json:"schema"`
}

type ResponseDataPayload

type ResponseDataPayload struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

ResponseDataPayload is generic struct received from dgraph

Jump to

Keyboard shortcuts

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