dgraph

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

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) 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