dgraph

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const SourceType string = "dgraph"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name      string `yaml:"name" validate:"required"`
	Type      string `yaml:"type" validate:"required"`
	DgraphUrl string `yaml:"dgraphUrl" validate:"required"`
	User      string `yaml:"user"`
	Password  string `yaml:"password"`
	Namespace uint64 `yaml:"namespace"`
	ApiKey    string `yaml:"apiKey"`
}

func (Config) Initialize

func (r Config) Initialize(ctx context.Context, tracer trace.Tracer) (sources.Source, error)

func (Config) SourceConfigType

func (r Config) SourceConfigType() string

type DgraphClient

type DgraphClient struct {
	*HttpToken
	// contains filtered or unexported fields
}

func (*DgraphClient) ExecuteQuery

func (hc *DgraphClient) ExecuteQuery(query string, paramsMap map[string]interface{},
	isQuery bool, timeout string) ([]byte, error)

type HttpToken

type HttpToken struct {
	UserId       string
	Password     string
	AccessJwt    string
	RefreshToken string
	Namespace    uint64
}

HttpToken stores credentials for making HTTP request

type Source

type Source struct {
	Config
	Client *DgraphClient `yaml:"client"`
}

func (*Source) DgraphClient

func (s *Source) DgraphClient() *DgraphClient

func (*Source) IsReadOnly added in v1.10.0

func (s *Source) IsReadOnly() bool

func (*Source) RunSQL

func (s *Source) RunSQL(statement string, params parameters.ParamValues, isQuery bool, timeout string) (any, error)

func (*Source) SourceType

func (s *Source) SourceType() string

func (*Source) ToConfig

func (s *Source) ToConfig() sources.SourceConfig

Jump to

Keyboard shortcuts

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