call

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	// contains filtered or unexported fields
}

func NewArgument

func NewArgument(name string, value Literal) *Argument

func (*Argument) Name

func (arg *Argument) Name() string

func (*Argument) Tainted

func (arg *Argument) Tainted() bool

Tainted returns true if the Call contains any tainted selectors.

func (*Argument) Value

func (arg *Argument) Value() Literal

type ID

type ID struct {
	// contains filtered or unexported fields
}

ID represents a GraphQL value of a certain type, constructed by evaluating its contained pipeline. In other words, it represents a constructor-addressed value, which may be an object, an array, or a scalar value.

It may be binary=>base64-encoded to be used as a GraphQL ID value for objects. Alternatively it may be stored in a database and referred to via an RFC-6920 ni://sha-256;... URI.

This type wraps the underlying proto DAG+Call types in order to enforce immutability of its fields and give it a name more appropriate for how it's used in the context of dagql + the engine.

IDs are immutable from the consumer's perspective. Rather than mutating an ID, methods on ID can be used to create a new ID on top of an existing (immutable) Base ID (e.g. Append, SelectNth, etc.).

func New

func New() *ID

func (*ID) Append

func (id *ID) Append(
	ret *ast.Type,
	field string,
	mod *Module,
	tainted bool,
	nth int,
	args ...*Argument,
) *ID

func (*ID) Args

func (id *ID) Args() []*Argument

GraphQL field arguments, always in alphabetical order. NOTE: use with caution, any inplace writes to elements of the returned slice can corrupt the ID

func (*ID) Base

func (id *ID) Base() *ID

The ID of the object that the field selection will be evaluated against.

If nil, the root Query object is implied.

func (*ID) Call added in v0.11.0

func (id *ID) Call() *callpbv1.Call

The root Call of the ID, with its Digest set. Exposed so that Calls can be streamed over the wire one-by-one, rather than emitting full DAGs, which would involve a ton of duplication.

WARRANTY VOID IF MUTATIONS ARE MADE TO THE INNER PROTOBUF. Perform a proto.Clone before mutating.

func (*ID) Decode

func (id *ID) Decode(str string) error

func (*ID) Digest

func (id *ID) Digest() digest.Digest

Digest returns the digest of the encoded ID. It does NOT canonicalize the ID first.

func (*ID) Display

func (id *ID) Display() string

func (*ID) DisplaySelf

func (id *ID) DisplaySelf() string

func (*ID) Encode

func (id *ID) Encode() (string, error)

func (*ID) Field

func (id *ID) Field() string

GraphQL field name.

func (*ID) FromAnyPB

func (id *ID) FromAnyPB(data *anypb.Any) error

func (*ID) Inputs

func (id *ID) Inputs() ([]digest.Digest, error)

func (*ID) IsTainted

func (id *ID) IsTainted() bool

Tainted returns true if the ID contains any tainted selectors. If true, this Selector is not reproducible.

func (*ID) Module

func (id *ID) Module() *Module

The module that provides the implementation of the field, if any.

func (*ID) Modules

func (id *ID) Modules() []*Module

func (*ID) Nth

func (id *ID) Nth() int64

If the field returns a list, this is the index of the element to select. Note that this defaults to zero, which means there is no selection of an element in the list. Non-zero indexes are 1-based.

func (*ID) Path

func (id *ID) Path() string

func (*ID) SelectNth

func (id *ID) SelectNth(nth int) *ID

func (*ID) ToProto

func (id *ID) ToProto() (*callpbv1.DAG, error)

NOTE: use with caution, any mutations to the returned proto can corrupt the ID

func (*ID) Type

func (id *ID) Type() *Type

The GraphQL type of the value.

type Literal

type Literal interface {
	Inputs() ([]digest.Digest, error)
	Modules() []*Module
	Tainted() bool
	Display() string
	ToInput() any
	ToAST() *ast.Value
	// contains filtered or unexported methods
}

type LiteralBool

func NewLiteralBool

func NewLiteralBool(val bool) *LiteralBool

type LiteralEnum

func NewLiteralEnum

func NewLiteralEnum(val string) *LiteralEnum

type LiteralFloat

func NewLiteralFloat

func NewLiteralFloat(val float64) *LiteralFloat

type LiteralID

type LiteralID struct {
	// contains filtered or unexported fields
}

func NewLiteralID

func NewLiteralID(id *ID) *LiteralID

func (*LiteralID) Display

func (lit *LiteralID) Display() string

func (*LiteralID) Inputs

func (lit *LiteralID) Inputs() ([]digest.Digest, error)

func (*LiteralID) Modules

func (lit *LiteralID) Modules() []*Module

func (*LiteralID) Tainted

func (lit *LiteralID) Tainted() bool

func (*LiteralID) ToAST

func (lit *LiteralID) ToAST() *ast.Value

func (*LiteralID) ToInput

func (lit *LiteralID) ToInput() any

func (*LiteralID) Value

func (lit *LiteralID) Value() *ID

type LiteralInt

func NewLiteralInt

func NewLiteralInt(val int64) *LiteralInt

type LiteralList

type LiteralList struct {
	// contains filtered or unexported fields
}

func NewLiteralList

func NewLiteralList(values ...Literal) *LiteralList

func (*LiteralList) Display

func (lit *LiteralList) Display() string

func (*LiteralList) Inputs

func (lit *LiteralList) Inputs() ([]digest.Digest, error)

func (*LiteralList) Modules

func (lit *LiteralList) Modules() []*Module

func (*LiteralList) Range

func (lit *LiteralList) Range(fn func(int, Literal) error) error

func (*LiteralList) Tainted

func (lit *LiteralList) Tainted() bool

func (*LiteralList) ToAST

func (lit *LiteralList) ToAST() *ast.Value

func (*LiteralList) ToInput

func (lit *LiteralList) ToInput() any

type LiteralNull

func NewLiteralNull

func NewLiteralNull() *LiteralNull

type LiteralObject

type LiteralObject struct {
	// contains filtered or unexported fields
}

func NewLiteralObject

func NewLiteralObject(values ...*Argument) *LiteralObject

func (*LiteralObject) Display

func (lit *LiteralObject) Display() string

func (*LiteralObject) Inputs

func (lit *LiteralObject) Inputs() ([]digest.Digest, error)

func (*LiteralObject) Modules

func (lit *LiteralObject) Modules() []*Module

func (*LiteralObject) Range

func (lit *LiteralObject) Range(fn func(int, string, Literal) error) error

func (*LiteralObject) Tainted

func (lit *LiteralObject) Tainted() bool

func (*LiteralObject) ToAST

func (lit *LiteralObject) ToAST() *ast.Value

func (*LiteralObject) ToInput

func (lit *LiteralObject) ToInput() any

type LiteralPrimitiveType

type LiteralPrimitiveType[T comparable, V callpbv1.LiteralValue[T]] struct {
	// contains filtered or unexported fields
}

func (*LiteralPrimitiveType[T, V]) Display

func (lit *LiteralPrimitiveType[T, V]) Display() string

func (*LiteralPrimitiveType[T, V]) Inputs

func (lit *LiteralPrimitiveType[T, V]) Inputs() ([]digest.Digest, error)

func (*LiteralPrimitiveType[T, V]) Modules

func (lit *LiteralPrimitiveType[T, V]) Modules() []*Module

func (*LiteralPrimitiveType[T, V]) Tainted

func (lit *LiteralPrimitiveType[T, V]) Tainted() bool

func (*LiteralPrimitiveType[T, V]) ToAST

func (lit *LiteralPrimitiveType[T, V]) ToAST() *ast.Value

func (*LiteralPrimitiveType[T, V]) ToInput

func (lit *LiteralPrimitiveType[T, V]) ToInput() any

func (*LiteralPrimitiveType[T, V]) Value

func (lit *LiteralPrimitiveType[T, V]) Value() T

type LiteralString

func NewLiteralString

func NewLiteralString(val string) *LiteralString

type Literate

type Literate interface {
	ToLiteral() Literal
}

type Module

type Module struct {
	// contains filtered or unexported fields
}

func NewModule

func NewModule(id *ID, name, ref string) *Module

func (*Module) ID

func (m *Module) ID() *ID

type Type

type Type struct {
	// contains filtered or unexported fields
}

func NewType

func NewType(gqlType *ast.Type) *Type

func (*Type) NamedType

func (t *Type) NamedType() string

func (*Type) ToAST

func (t *Type) ToAST() *ast.Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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