dgraph

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SourceKind string = "dgraph"

Variables

This section is empty.

Functions

func CheckError

func CheckError(resp []byte) error

Types

type Config

type Config struct {
	Name      string `yaml:"name" validate:"required"`
	Kind      string `yaml:"kind" 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) SourceConfigKind

func (r Config) SourceConfigKind() 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 {
	Name   string        `yaml:"name"`
	Kind   string        `yaml:"kind"`
	Client *DgraphClient `yaml:"client"`
}

func (*Source) DgraphClient

func (s *Source) DgraphClient() *DgraphClient

func (*Source) SourceKind

func (s *Source) SourceKind() string

Jump to

Keyboard shortcuts

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