call

package
v0.21.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ExtraDigestLabelContent = "content"
)

Variables

This section is empty.

Functions

func AppendArgumentBytes added in v0.18.18

func AppendArgumentBytes(arg *Argument, h *hashutil.Hasher) (*hashutil.Hasher, error)

AppendArgumentBytes appends a binary representation of the given argument to the given byte slice.

Types

type Argument

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

func NewArgument

func NewArgument(name string, value Literal, isSensitive bool) *Argument

func (*Argument) IsSensitive added in v0.19.3

func (arg *Argument) IsSensitive() bool

func (*Argument) Name

func (arg *Argument) Name() string

func (*Argument) PB added in v0.18.18

func (arg *Argument) PB() *callpbv1.Argument

The pb representation of the arg.

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

func (*Argument) Value

func (arg *Argument) Value() Literal

func (*Argument) WithValue added in v0.18.4

func (arg *Argument) WithValue(value Literal) *Argument

type ExtraDigest added in v0.21.0

type ExtraDigest struct {
	Digest digest.Digest
	Label  string
}

type ID

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

ID represents a boundary GraphQL ID value.

It is either: - a recipe-form constructor-addressed DAG of Calls - a handle-form opaque engine-local reference to a cached result

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.

Recipe-form IDs support the historical recipe-manipulation operations such as Append and With.

Handle-form IDs are opaque top-level references only. Recipe-manipulation operations on handle-form IDs panic rather than faking recipe structure.

func New

func New() *ID

func NewEngineResultID added in v0.21.0

func NewEngineResultID(resultID uint64, typ *Type) *ID

func (*ID) Append

func (id *ID) Append(ret *ast.Type, field string, opts ...IDOpt) *ID

func (*ID) Arg added in v0.19.3

func (id *ID) Arg(name string) *Argument

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) 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) ContentDigest added in v0.19.11

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

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

NOTE: DisplaySelf can be very expensive, do not use in hot paths

func (*ID) EffectIDs added in v0.19.11

func (id *ID) EffectIDs() []string

EffectIDs returns the effect IDs directly attached to this call.

func (*ID) Encode

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

func (*ID) EngineResultID added in v0.21.0

func (id *ID) EngineResultID() uint64

func (*ID) ExtraDigests added in v0.21.0

func (id *ID) ExtraDigests() []ExtraDigest

func (*ID) Field

func (id *ID) Field() string

GraphQL field name.

func (*ID) FromProto added in v0.18.17

func (id *ID) FromProto(dagPB *callpbv1.DAG) error

func (*ID) ImplicitInputs added in v0.21.0

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

ImplicitInputs are inputs to the call that are computed by the engine rather than explicitly set by a GraphQL caller.

NOTE: use with caution, any inplace writes to elements of the returned slice can corrupt the ID

func (*ID) Inputs

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

Inputs returns the ID digests referenced by this ID, starting with the receiver, if any.

func (*ID) IsHandle added in v0.21.0

func (id *ID) IsHandle() bool

func (*ID) MarshalJSON added in v0.12.0

func (id *ID) MarshalJSON() ([]byte, error)

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) Name added in v0.16.3

func (id *ID) Name() string

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

NOTE: Path can be very expensive, do not use in hot paths

func (*ID) Receiver added in v0.12.1

func (id *ID) Receiver() *ID

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

If nil, the root Query object is implied.

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.

func (*ID) UnmarshalJSON added in v0.12.0

func (id *ID) UnmarshalJSON(data []byte) error

func (*ID) View added in v0.12.0

func (id *ID) View() View

GraphQL view.

func (*ID) With added in v0.19.3

func (id *ID) With(opts ...IDOpt) *ID

type IDOpt added in v0.19.3

type IDOpt func(*ID)

func WithArgs added in v0.19.3

func WithArgs(args ...*Argument) IDOpt

func WithContentDigest added in v0.19.11

func WithContentDigest(dig digest.Digest) IDOpt

func WithEffectIDs added in v0.19.11

func WithEffectIDs(effectIDs []string) IDOpt

func WithExtraDigest added in v0.21.0

func WithExtraDigest(extra ExtraDigest) IDOpt

func WithImplicitInputs added in v0.21.0

func WithImplicitInputs(inputs ...*Argument) IDOpt

func WithModule added in v0.19.3

func WithModule(mod *Module) IDOpt

func WithNth added in v0.19.3

func WithNth(n int) IDOpt

func WithView added in v0.19.3

func WithView(view View) IDOpt

type Literal

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

func ToLiteral added in v0.17.0

func ToLiteral(val any) (Literal, error)

ToLiteral converts any JSON-serializable value to a Literal.

type LiteralBool

func NewLiteralBool

func NewLiteralBool(val bool) *LiteralBool

type LiteralDigestedString added in v0.21.0

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

func NewLiteralDigestedString added in v0.21.0

func NewLiteralDigestedString(value string, digest digest.Digest) *LiteralDigestedString

func (*LiteralDigestedString) Digest added in v0.21.0

func (lit *LiteralDigestedString) Digest() digest.Digest

func (*LiteralDigestedString) Display added in v0.21.0

func (lit *LiteralDigestedString) Display() string

func (*LiteralDigestedString) Inputs added in v0.21.0

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

func (*LiteralDigestedString) Modules added in v0.21.0

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

func (*LiteralDigestedString) ToAST added in v0.21.0

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

func (*LiteralDigestedString) ToInput added in v0.21.0

func (lit *LiteralDigestedString) ToInput() any

func (*LiteralDigestedString) Value added in v0.21.0

func (lit *LiteralDigestedString) Value() string

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) 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) Len added in v0.15.3

func (lit *LiteralList) Len() int

func (*LiteralList) Modules

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

func (*LiteralList) ToAST

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

func (*LiteralList) ToInput

func (lit *LiteralList) ToInput() any

func (*LiteralList) Values added in v0.19.3

func (lit *LiteralList) Values() iter.Seq2[int, Literal]

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) Args added in v0.19.3

func (lit *LiteralObject) Args() iter.Seq2[int, *Argument]

func (*LiteralObject) Display

func (lit *LiteralObject) Display() string

func (*LiteralObject) Inputs

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

func (*LiteralObject) Len added in v0.15.3

func (lit *LiteralObject) Len() int

func (*LiteralObject) Modules

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

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]) 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, pin string) *Module

func (*Module) ID

func (m *Module) ID() *ID

func (*Module) Name added in v0.19.8

func (m *Module) Name() string

func (*Module) Pin added in v0.21.0

func (m *Module) Pin() string

func (*Module) Ref added in v0.21.0

func (m *Module) Ref() string

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

type View added in v0.18.17

type View string

func (View) String added in v0.19.3

func (v View) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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