package
2.0.0-rc1+incompatible
Repository: https://github.com/dgraph-io/dgraph.git
Documentation: pkg.go.dev

# Functions

AddCorsHeaders adds the CORS headers to an HTTP response.
AddInit adds a function to be run in x.Init, which should be called at the beginning of all mains.
No description provided by the author
AskUserPassword prompts the user to enter the password for the given user ID.
AssertTrue asserts that b is true.
AssertTruef is AssertTrue with extra info.
AssertTruefNoTrace is AssertTruef without a stack trace.
AttachAccessJwt adds any incoming JWT header data into the grpc context metadata.
BuildDetails returns a string containing details about the Dgraph binary.
Check logs fatal if err != nil.
Check2 acts as convenience wrapper around Check, using the 2nd argument as error.
Checkf is Check with extra info.
CheckfNoLog exits on error without any message (to avoid duplicate error messages).
CheckfNoTrace is Checkf without a stack trace.
CountKey generates a count key with the given attribute and uid.
DataKey generates a data key with the given attribute and UID.
Diff computes the difference between the keys of the two given maps.
DivideAndRule is used to divide a number of tasks among multiple go routines.
ExecutableChecksum returns a byte slice containing the SHA256 checksum of the executable.
Fatalf logs fatal.
FindDataFiles returns a list of data files as a string array.
FindFilesFunc walks the directory 'dir' and collects all file names matched by func f.
FixedDuration returns the given duration as a string of fixed length.
FromBackupKey takes a key in the format used for backups and converts it to a key.
GenerateClientTLSConfig creates and returns a new client side *tls.Config with the configuration provided.
GenerateServerTLSConfig creates and returns a new *tls.Config with the configuration provided.
GetDgraphClient creates a Dgraph client based on the following options in the configuration: --alpha specifies a comma separated list of endpoints to connect to --tls_cacert, --tls_cert, --tls_key etc specify the TLS configuration of the connection --retries specifies how many times we should retry the connection to each endpoint upon failures --user and --password specify the credentials we should use to login with the server.
GetPassAndLogin uses the given credentials and client to perform the login operation.
GetRandomName generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname".
GetSplitKey takes a key baseKey and generates the key of the list split that starts at startUid.
GqlErrorf returns a new GqlError with the message and args Sprintf'ed as the GqlError's Message.
HasString returns whether the slice contains the given string.
HealthCheck returns whether the server is ready to accept requests or not Load balancer would add the node to the endpoint once health check starts returning true.
Ignore function is used to ignore errors deliberately, while keeping the linter happy.
IndexKey generates a index key with the given attribute and term.
Init initializes flags and run all functions in initFunc.
IsAclPredicate returns true if the predicate is in the list of reserved predicates for the ACL feature.
IsGraphqlReservedPredicate returns true if it is the predicate is reserved by graphql.
No description provided by the author
IsInternalPredicate returns true if the predicate is in the internal predicate list.
IsMissingOrEmptyDir returns true if the path either does not exist or is a directory that is empty.
IsReservedPredicate returns true if the predicate is in the reserved predicate list.
IsTestRun indicates whether a test is being executed.
LoadClientTLSConfig loads the TLS config into the client with the given parameters.
LoadServerTLSConfig loads the TLS config into the server with the given parameters.
Max returns the maximum of the two given numbers.
MetricsContext returns a context with tags that are useful for distinguishing the state of the running system.
Min returns the minimum of the two given numbers.
NewHistogram initializes a given Histogram.
PageRange returns start and end indices given pagination params.
Parse would parse the key.
ParseRequest parses the body of the given request.
PredicateLang extracts the language from a predicate (or facet) name.
PredicatePrefix returns the prefix for all keys belonging to this predicate except schema key.
PrintVersion prints version and other helpful information if --version.
ReadGroupIdFile reads the file at the given path and attempts to retrieve the group ID stored in it.
ReadLine reads a single line from a buffered reader.
RegisterClientTLSFlags registers the required flags to set up a TLS client.
RegisterExporters sets up the services to which metrics will be exported.
RemoveDuplicates sorts the slice of strings and removes duplicates.
Reply sets the body of an HTTP response to the JSON representation of the given reply.
ReservedPredicates returns the complete list of reserved predicates that needs to be expanded when * is given as a predicate.
RetryUntilSuccess runs the given function until it succeeds or can no longer be retried.
ReverseKey generates a reverse key with the given attribute and UID.
RunVlogGC runs value log gc on store.
SchemaKey returns schema key for given attribute.
SchemaPrefix returns the prefix for Schema keys.
SetHttpStatus is similar to SetStatus but sets a proper HTTP status code in the response instead of always returning HTTP 200 (OK).
SetStatus sets the error code, message and the newly assigned uids in the http response.
SetStatusWithData sets the errors in the response and ensures that the data key in the data is present with value nil.
SetTestRun sets a variable to indicate that the current execution is a test.
SetupConnection starts a secure gRPC connection to the given host.
ShouldCrash returns true if the error should cause the process to crash.
SinceMs returns the time since startTime in milliseconds (as a float).
SpanTimer returns a function used to record the duration of the given span.
StartProfile starts a new mode for profiling.
TypeKey returns type key for given type name.
TypePrefix returns the prefix for Schema keys.
Unique takes an array and returns it with no duplicate entries.
UpdateDrainingMode updates the server's draining mode.
UpdateHealthStatus updates the server's health status so it can start accepting requests.
ValidateAddress checks whether given address can be used with grpc dial function.
ValueType s a helper function to decide value type of DirectedEdge/Posting/N-Quad.
Version returns a string containing the dgraphVersion.
WalkPathFunc walks the directory 'dir' and collects all path names matched by func f.
WithMethod returns a new updated context with the tag KeyMethod set to the given value.
WriteFileSync is the same as bufio.WriteFile, but syncs the data before closing.
WriteGroupIdFile writes the given group ID to the group_id file inside the given postings directory.
Write response body, transparently compressing if necessary.

# Constants

AclPredicates is the JSON representation of the predicates reserved for use by the ACL system.
ByteCount indicates the key stores a count index.
ByteCountRev indicates the key stores a reverse count index.
ByteData indicates the key stores data.
ByteIndex indicates the key stores an index.
ByteReverse indicates the key stores a reverse index.
ByteSplit is a constant to specify a given key corresponds to a posting list split into multiple parts.
ByteUnused is a constant to specify keys which need to be discarded.
DefaultPrefix is the prefix used for data, index and reverse keys so that relative order of data doesn't change keys of same attributes are located together.
Error is a general error code.
ErrorInvalidMethod is equivalent to the HTTP 405 error code.
ErrorInvalidRequest is equivalent to the HTTP 400 error code.
ErrorNoData is an error returned when the requested data cannot be returned.
ErrorUnauthorized is equivalent to the HTTP 401 error code.
FacetDelimeter is the symbol used to distinguish predicate names from facets.
ForceAbortDifference is the maximum allowed difference between AppliedUntil - TxnMarks.DoneUntil() before old transactions start getting aborted.
GraphqlPredicates is the json representation of the predicate reserved for graphql system.
GrootId is the ID of the admin user for ACLs.
GroupIdFileName is the name of the file storing the ID of the group to which the data in a postings directory belongs.
GrpcMaxSize is the maximum possible size for a gRPC message.
GuardiansId is the ID of the admin group for ACLs.
PortGrpc is the default gRPC port for alpha.
PortHTTP is the default HTTP port for alpha.
PortInternal is the default port for internal use.
PortZeroGrpc is the default gRPC port for zero.
PortZeroHTTP is the default HTTP port for zero.
Star is equivalent to using * in a mutation.
Success is equivalent to the HTTP 200 error code.
ValidHostnameRegex is a regex that accepts our expected hostname format.
ValueEmpty represents a value with no UID and no value.
ValueMulti represents a value which is part of a multi-value posting list (like language).
ValuePlain represents a plain old value without defined language tag.
ValueUid represents a value with an UID.
ValueUnknown represents an unknown type of value.

# Variables

ActiveMutations is the current number of active mutations.
AlphaHealth status records the current health of the alphas.
Conf holds the metrics config.
Config stores the global instance of this package's options.
ErrMissingDir is thrown by IsMissingOrEmptyDir if the given path is a missing or empty directory.
ErrNotSupported is thrown when an enterprise feature is requested in the open source version.
KeyMethod is the tag key used to record the method (e.g read or mutate).
KeyStatus is the tag key used to record the status of the server.
LatencyMs is the latency of the various Dgraph operations.
MaxAssignedTs records the latest max assigned timestamp.
MemoryIdle records the amount of memory held by the runtime but not in-use by Dgraph.
MemoryInUse records the current amount of used memory by Dgraph.
MemoryProc records the amount of memory used in processes.
Nilbyte is a nil byte slice.
NumEdges is the total number of edges created so far.
NumMutations is the total number of mutations processed so far.
NumQueries is the total number of queries processed so far.
PendingProposals records the current number of pending RAFT proposals.
PendingQueries records the current number of pending queries.
RaftAppliedIndex records the latest applied RAFT index.
TagValueStatusError is the tag value used to signal an unsuccessful operation.
TagValueStatusOK is the tag value used to signal a successful operation.
WhiteSpace Replacer removes spaces and tabs from a string.
WorkerConfig stores the global instance of the worker package's options.

# Structs

BytesBuffer provides a buffer backed by byte slices.
CredOpt stores the options for logging in, including the password and user.
GqlError is a GraphQL spec compliant error structure.
A Histogram collects observed values by keeping bucketed counts.
IPRange represents an IP range.
A Location is the Line+Column index of an error in a request.
Options stores the options for this package.
ParsedKey represents a key that has been parsed into its multiple attributes.
QueryResWithData represents a response that holds errors as well as data.
SafeMutex can be used in place of sync.RWMutex.
SubCommand a represents a sub-command in the command-line interface.
Timer implements a timer that supports recording the duration of events.
TLSHelperConfig define params used to create a tls.Config.
ToGlog is a logger that forwards the output to glog.
WorkerOptions stores the options for the worker package.

# Interfaces

Stopper is an interface tasked with stopping the profiling process.

# Type aliases

CloseFunc needs to be called to close all the client connections.
GqlErrorList is a list of GraphQL errors as would be found in a response.
ValueTypeInfo represents information about the type of values in DirectedEdge/Posting/N-Quad.