core

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: 160 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxFunctionCacheTTLSeconds = 7 * 24 * 60 * 60 // 1 week
	MinFunctionCacheTTLSeconds = 1
)
View Source
const (
	// DetachGracePeriod is an arbitrary amount of time between when a service is
	// no longer actively used and before it is detached. This is to avoid repeated
	// stopping and re-starting of the same service in rapid succession.
	DetachGracePeriod = 10 * time.Second

	// TerminateGracePeriod is an arbitrary amount of time between when a service is
	// sent a graceful stop (SIGTERM) and when it is sent an immediate stop (SIGKILL).
	TerminateGracePeriod = 10 * time.Second
)
View Source
const ChangesetPatchFilename = "diff.patch"
View Source
const InstrumentationLibrary = "dagger.io/core"
View Source
const (
	ModuleName = "daggercore"
)
View Source
const ServiceNameAttr = "dagger.io/service.name"

ServiceNameAttr is the telemetry attribute key for the service name. Defined locally because the canonical constant lives in the external github.com/dagger/otel-go package which we cannot modify.

View Source
const (
	ShimEnableTTYEnvVar = "_DAGGER_ENABLE_TTY"
)

Variables

View Source
var (
	CacheSharingModeShared = CacheSharingModes.Register("SHARED",
		"Shares the cache volume amongst many build pipelines")
	CacheSharingModePrivate = CacheSharingModes.Register("PRIVATE",
		"Keeps a cache volume for a single build pipeline")
	CacheSharingModeLocked = CacheSharingModes.Register("LOCKED",
		"Shares the cache volume amongst many build pipelines, but will serialize the writes")
)
View Source
var (
	DiffStatKindAdded = DiffStatKindEnum.Register("ADDED",
		`A file or directory was added.`)
	DiffStatKindModified = DiffStatKindEnum.Register("MODIFIED",
		`A file was modified.`)
	DiffStatKindRemoved = DiffStatKindEnum.Register("REMOVED",
		`A file or directory was removed.`)
	DiffStatKindRenamed = DiffStatKindEnum.Register("RENAMED",
		`A file was renamed.`)
)
View Source
var (
	ErrAddedTwice      = errors.New("path added in both changesets")
	ErrModifiedTwice   = errors.New("path modified in both changesets")
	ErrModifiedRemoved = errors.New("path modified in one changeset and removed in the other")
)
View Source
var (
	CompressionGzip = ImageLayerCompressions.Register("Gzip")

	CompressionZstd = ImageLayerCompressions.Register("Zstd")

	CompressionEStarGZ = ImageLayerCompressions.Register("EStarGZ")

	CompressionUncompressed = ImageLayerCompressions.Register("Uncompressed")
)
View Source
var (
	OCIMediaTypes = ImageMediaTypesEnum.Register("OCIMediaTypes")

	DockerMediaTypes = ImageMediaTypesEnum.Register("DockerMediaTypes")
)
View Source
var (
	ReturnSuccess = ReturnTypesEnum.Register("SUCCESS",
		`A successful execution (exit code 0)`,
	)
	ReturnFailure = ReturnTypesEnum.Register("FAILURE",
		`A failed execution (exit codes 1-127 and 192-255)`,
	)
	ReturnAny = ReturnTypesEnum.Register("ANY",
		`Any execution (exit codes 0-127 and 192-255)`,
	)
)
View Source
var (
	ExistsTypeRegular = ExistsTypes.Register("REGULAR_TYPE",
		"Tests path is a regular file")
	ExistsTypeDirectory = ExistsTypes.Register("DIRECTORY_TYPE",
		"Tests path is a directory")
	ExistsTypeSymlink = ExistsTypes.Register("SYMLINK_TYPE",
		"Tests path is a symlink")
)
View Source
var (
	FileTypeRegular   = FileTypes.RegisterView("REGULAR", enumView, "regular file type")
	FileTypeDirectory = FileTypes.RegisterView("DIRECTORY", enumView, "directory file type")
	FileTypeSymlink   = FileTypes.RegisterView("SYMLINK", enumView, "symlink file type")
	FileTypeUnknown   = FileTypes.Register("UNKNOWN", "unknown file type")
)
View Source
var (
	ModuleSourceKindLocal = ModuleSourceKindEnum.Register("LOCAL_SOURCE")

	ModuleSourceKindGit = ModuleSourceKindEnum.Register("GIT_SOURCE")

	ModuleSourceKindDir = ModuleSourceKindEnum.Register("DIR_SOURCE")
)
View Source
var (
	NetworkProtocolTCP = NetworkProtocols.Register("TCP")
	NetworkProtocolUDP = NetworkProtocols.Register("UDP")
)
View Source
var (
	ErrNoCurrentModule    = fmt.Errorf("no current module")
	ErrNoCurrentWorkspace = fmt.Errorf("no current workspace")
)
View Source
var (
	FunctionCachePolicyDefault    = FunctionCachePolicyEnum.Register("Default")
	FunctionCachePolicyPerSession = FunctionCachePolicyEnum.Register("PerSession")
	FunctionCachePolicyNever      = FunctionCachePolicyEnum.Register("Never")
)
View Source
var (
	TypeDefKindString = TypeDefKinds.Register("STRING_KIND", "A string value.")

	TypeDefKindInteger = TypeDefKinds.Register("INTEGER_KIND", "An integer value.")

	TypeDefKindFloat = TypeDefKinds.Register("FLOAT_KIND", "A float value.")

	TypeDefKindBoolean = TypeDefKinds.Register("BOOLEAN_KIND", "A boolean value.")

	TypeDefKindScalar = TypeDefKinds.Register("SCALAR_KIND", "A scalar value of any basic kind.")

	TypeDefKindList = TypeDefKinds.Register("LIST_KIND",
		"Always paired with a ListTypeDef.",
		"A list of values all having the same type.")

	TypeDefKindObject = TypeDefKinds.Register("OBJECT_KIND",
		"Always paired with an ObjectTypeDef.",
		"A named type defined in the GraphQL schema, with fields and functions.")

	TypeDefKindInterface = TypeDefKinds.Register("INTERFACE_KIND",
		"Always paired with an InterfaceTypeDef.",
		`A named type of functions that can be matched+implemented by other objects+interfaces.`)

	TypeDefKindInput = TypeDefKinds.Register("INPUT_KIND",
		`A graphql input type, used only when representing the core API via TypeDefs.`)

	TypeDefKindVoid = TypeDefKinds.Register("VOID_KIND",
		"A special kind used to signify that no value is returned.",
		`This is used for functions that have no return value. The outer TypeDef
		specifying this Kind is always Optional, as the Void is never actually
		represented.`,
	)

	TypeDefKindEnum = TypeDefKinds.Register("ENUM_KIND",
		"A GraphQL enum type and its values",
		"Always paired with an EnumTypeDef.",
	)
)
View Source
var AllVersion = dagql.AllView{}

AllVersion is a view that contains all versions.

View Source
var CachePerCallerModule = dagql.ImplicitInput{
	Name: "cachePerCallerModule",
	Resolver: func(ctx context.Context, _ map[string]dagql.Input) (dagql.Input, error) {
		q, err := CurrentQuery(ctx)
		if err != nil {
			return nil, fmt.Errorf("current query: %w", err)
		}
		m, err := q.CurrentModule(ctx)
		if errors.Is(err, ErrNoCurrentModule) {
			return dagql.NewString("mainClient"), nil
		}
		if err != nil {
			return dagql.NewString(""), fmt.Errorf("failed to get current module: %w", err)
		}
		if m.Self() == nil {
			return dagql.NewString("mainClient"), nil
		}

		scopedMod, err := ImplementationScopedModule(ctx, m)
		if err != nil {
			return nil, err
		}
		scopeDigest, err := scopedMod.ContentPreferredDigest(ctx)
		if err != nil {
			return nil, err
		}

		return dagql.NewString(scopeDigest.String()), nil
	},
}

CachePerCallerModule scopes a call ID per caller module (using the module's source content digest). If the caller is not in a module, the input is just an empty string.

View Source
var CacheSharingModes = dagql.NewEnum[CacheSharingMode]()
View Source
var DiffStatKindEnum = dagql.NewEnum[DiffStatKind]()
View Source
var ErrMountNotExist = errors.New("mount does not exist")
View Source
var ErrNoCommand = errors.New("no command has been set")
View Source
var ErrNoSvcCommand = errors.New("no service command has been set")
View Source
var ExistsTypes = dagql.NewEnum[ExistsType]()
View Source
var FileTypes = dagql.NewEnum[FileType]()
View Source
var FunctionCachePolicyEnum = dagql.NewEnum[FunctionCachePolicy]()
View Source
var ImageLayerCompressions = dagql.NewEnum[ImageLayerCompression]()
View Source
var ImageMediaTypesEnum = dagql.NewEnum[ImageMediaTypes]()
View Source
var ModuleSourceExperimentalFeatureSelfCalls = ModuleSourceExperimentalFeatures.Register("SELF_CALLS", "Self calls")
View Source
var ModuleSourceExperimentalFeatures = dagql.NewEnum[ModuleSourceExperimentalFeature]()
View Source
var ModuleSourceKindEnum = dagql.NewEnum[ModuleSourceKind]()
View Source
var NetworkProtocols = dagql.NewEnum[NetworkProtocol]()
View Source
var ReturnTypesEnum = dagql.NewEnum[ReturnTypes]()
View Source
var TypeDefKinds = dagql.NewEnum[TypeDefKind]()
View Source
var TypesHiddenFromModuleSDKs = []dagql.Typed{
	&Engine{},
	&EngineCache{},
	&EngineCacheEntry{},
	&EngineCacheEntrySet{},
}

We don't expose these types to modules SDK codegen, but we still want their graphql schemas to be available for internal usage. So we use this list to scrub them from the introspection JSON that module SDKs use for codegen.

View Source
var TypesToIgnoreForModuleIntrospection = []string{"Host"}

Functions

func AddEnv added in v0.6.0

func AddEnv(env []string, name, value string) []string

AddEnv adds or updates an environment variable in 'env'.

func AroundFunc added in v0.11.7

func AroundFunc(
	ctx context.Context,
	req *dagql.CallRequest,
) (
	context.Context,
	func(res dagql.AnyResult, cached bool, rerr *error),
)

func CallDirExists added in v0.20.4

func CallDirExists(ctx context.Context, dir dagql.ObjectResult[*Directory], path string) (string, bool, error)

func CloneContainerImageConfig added in v0.21.0

func CloneContainerImageConfig(cfg dockerspec.DockerOCIImageConfig) dockerspec.DockerOCIImageConfig

func ContextWithQuery added in v0.18.10

func ContextWithQuery(ctx context.Context, q *Query) context.Context

func CurrentDagqlServer added in v0.18.13

func CurrentDagqlServer(ctx context.Context) (*dagql.Server, error)

func DNSConfig added in v0.18.6

func DNSConfig(ctx context.Context) (*oci.DNSConfig, error)

func DagqlToCodegenDirective added in v0.20.4

func DagqlToCodegenDirective(dagqlDirective *introspection.DirectiveApplication) *codegenintrospection.Directive

DagqlToCodegenDirective converts a dagql directive application to a codegen directive.

func DagqlToCodegenDirectiveArg added in v0.20.4

func DagqlToCodegenDirectiveArg(dagqlArg *introspection.DirectiveApplicationArg) *codegenintrospection.DirectiveArg

DagqlToCodegenDirectiveArg converts a dagql directive application arg to a codegen directive arg.

func DagqlToCodegenDirectiveDef added in v0.20.4

func DagqlToCodegenDirectiveDef(dagqlDirective *introspection.Directive) (*codegenintrospection.DirectiveDef, error)

DagqlToCodegenDirectiveDef converts a dagql directive definition to a codegen directive def.

func DagqlToCodegenEnumValue added in v0.20.4

func DagqlToCodegenEnumValue(dagqlInputValue *introspection.EnumValue) codegenintrospection.EnumValue

DagqlToCodegenEnumValue converts a dagql enum value to a codegen enum value.

func DagqlToCodegenField added in v0.20.4

func DagqlToCodegenField(dagqlField *introspection.Field) (*codegenintrospection.Field, error)

DagqlToCodegenField converts a dagql introspection field to a codegen field.

func DagqlToCodegenInputValue added in v0.20.4

func DagqlToCodegenInputValue(dagqlInputValue *introspection.InputValue) (codegenintrospection.InputValue, error)

DagqlToCodegenInputValue converts a dagql input value to a codegen input value.

func DagqlToCodegenType added in v0.20.4

func DagqlToCodegenType(dagqlType *introspection.Type) (*codegenintrospection.Type, error)

DagqlToCodegenType converts a dagql introspection type to a codegen introspection type.

func DagqlToCodegenTypeRef added in v0.20.4

func DagqlToCodegenTypeRef(dagqlType *introspection.Type) (*codegenintrospection.TypeRef, error)

DagqlToCodegenTypeRef converts a dagql introspection type to a codegen type ref.

func DirectoryReadFile added in v0.20.4

func DirectoryReadFile(ctx context.Context, dir dagql.ObjectResult[*Directory], path string) ([]byte, error)

DirectoryReadFile reads file contents from a dagql Directory.

func EnvFromContext added in v0.19.0

func EnvFromContext(ctx context.Context) (dagql.ObjectResult[*Env], bool, error)

func EnvToContext added in v0.19.0

func EnvToContext(ctx context.Context, env dagql.ObjectResult[*Env]) context.Context

func ExportFile added in v0.21.0

func ExportFile(ctx context.Context, snapshot bkcache.ImmutableRef, filePath, dest string, allowParentDirPath bool) (rerr error)

func GetClientResourceAccessor added in v0.12.1

func GetClientResourceAccessor(ctx context.Context, parent *Query, externalName string) (string, error)

func GetContentHashFromDirectory added in v0.18.3

func GetContentHashFromDirectory(
	ctx context.Context,
	snapshot bkcache.ImmutableRef,
	dirPath string,
) (digest.Digest, error)

func GetContentHashFromFile added in v0.19.7

func GetContentHashFromFile(
	ctx context.Context,
	snapshot bkcache.ImmutableRef,
	filePath string,
) (digest.Digest, error)

func GitRefString added in v0.16.0

func GitRefString(cloneRef, sourceRootSubpath, version string) string

func HostUnixSocketHandle added in v0.21.0

func HostUnixSocketHandle(ctx context.Context, query *Query, path string) (dagql.SessionResourceHandle, error)

func ImplementationScopedModule added in v0.21.0

func ImplementationScopedModule(
	ctx context.Context,
	mod dagql.ObjectResult[*Module],
) (dagql.ObjectResult[*Module], error)

func ImplementationScopedModuleSource added in v0.21.0

func ImplementationScopedModuleSource(
	ctx context.Context,
	src dagql.ObjectResult[*ModuleSource],
) (dagql.ObjectResult[*ModuleSource], error)

func LookupEnv added in v0.6.0

func LookupEnv(env []string, name string) (string, bool)

LookupEnv returns the value of an environment variable.

func MergeImageConfig added in v0.21.0

func MountRef added in v0.18.7

func MountRef(ctx context.Context, ref bkcache.Ref, f func(string, *mount.Mount) error, optFns ...mountRefOptFn) error

MountRef is a utility for easily mounting a ref.

To simplify external logic, when the ref is nil, i.e. scratch, the callback just receives a tmpdir that gets deleted when the function completes.

func MountRefCloser added in v0.19.3

func MountRefCloser(ctx context.Context, ref bkcache.Ref, optFns ...mountRefOptFn) (_ string, _ *mount.Mount, _ func() error, rerr error)

MountRefCloser is a utility for mounting a ref.

To simplify external logic, when the ref is nil, i.e. scratch, a tmpdir is created (and deleted when the closer func is called).

NOTE: prefer MountRef where possible, unless finer-grained control of when the directory is unmounted is needed.

func NewErrorFromErr added in v0.20.0

func NewErrorFromErr(ctx context.Context, fromErr error) (objErr dagql.ObjectResult[*Error], outerErr error)

func OptSourceModuleName added in v0.21.0

func OptSourceModuleName(name string) dagql.Optional[dagql.String]

func OptString added in v0.21.0

func OptString(v *string) dagql.Optional[dagql.String]

func OptionalResultIDInput added in v0.21.0

func OptionalResultIDInput[T dagql.Typed](res dagql.ObjectResult[T]) (dagql.Optional[dagql.ID[T]], error)

func ResolveDepToSource added in v0.18.7

func ResolveDepToSource(
	ctx context.Context,
	bk *engineutil.Client,
	dag *dagql.Server,
	parentSrc *ModuleSource,
	depSrcRef string,
	depPin string,
	depName string,
) (inst dagql.ObjectResult[*ModuleSource], err error)

ResolveDepToSource given a parent module source, load a dependency of it from the given depSrcRef, depPin and depName.

func ResolveIndex added in v0.18.17

func ResolveIndex(ctx context.Context, store content.Store, desc specs.Descriptor, platform specs.Platform, tag string) (*specs.Descriptor, error)

func RestoreErrPath added in v0.19.9

func RestoreErrPath(err error, path string) error

RestoreErrPath will restore the path of an error, which is useful for both removing buildkit mount root paths and referencing uncleaned paths Note: TrimErrPathPrefix should be used instead when a root prefix is known

func ResultIDInput added in v0.21.0

func ResultIDInput[T dagql.Typed](res dagql.ObjectResult[T]) (dagql.ID[T], error)
func RootPathWithoutFinalSymlink(root, containerPath string) (string, error)

RootPathWithoutFinalSymlink joins a path with a root, evaluating and bounding all symlinks except the final component of the path (i.e. the basename component). This is useful for the case where one needs to reference a symlink rather than following it (e.g. deleting a symlink) This function will return an error if any of the symlinks encountered before the final path separator reference a location outside of the root path.

func ScopedNestedSSHAuthSocketHandle added in v0.21.0

func ScopedNestedSSHAuthSocketHandle(secretSalt []byte, fingerprints []string, clientID string) dagql.SessionResourceHandle

func ScopedSSHAuthSocketHandle added in v0.21.0

func ScopedSSHAuthSocketHandle(secretSalt []byte, fingerprints []string) dagql.SessionResourceHandle

func SecretHandleFromCacheKey added in v0.21.0

func SecretHandleFromCacheKey(cacheKey string) dagql.SessionResourceHandle

func SecretHandleFromPlaintext added in v0.21.0

func SecretHandleFromPlaintext(secretSalt []byte, plaintext []byte) dagql.SessionResourceHandle

func SelectFunctionWithServer added in v0.21.0

func SelectFunctionWithServer(ctx context.Context, dag *dagql.Server, name string, returnType dagql.ObjectResult[*TypeDef]) (dagql.ObjectResult[*Function], error)

func SelectTypeDef added in v0.21.0

func SelectTypeDef(ctx context.Context, sels ...dagql.Selector) (dagql.ObjectResult[*TypeDef], error)

func SelectTypeDefWithServer added in v0.21.0

func SelectTypeDefWithServer(ctx context.Context, dag *dagql.Server, sels ...dagql.Selector) (dagql.ObjectResult[*TypeDef], error)

func SetModuleSourceSDKLoader added in v0.21.0

func SetModuleSourceSDKLoader(loader func(context.Context, *Query, *SDKConfig, *ModuleSource) (SDK, error))

func SetSecretHandle added in v0.21.0

func SetSecretHandle(name string, accessor string) dagql.SessionResourceHandle

func StatFSExists added in v0.20.4

func StatFSExists(ctx context.Context, statFS StatFS, path string) (string, bool, error)

func Supports added in v0.18.11

func Supports(ctx context.Context, minVersion string) bool

func SupportsDirSlash added in v0.17.0

func SupportsDirSlash(ctx context.Context) bool

func ToolFunc added in v0.17.2

func ToolFunc[T any](srv *dagql.Server, fn func(context.Context, T) (any, error)) func(context.Context, any) (any, error)

ToolFunc reuses our regular GraphQL args handling sugar for tools.

func Tracer added in v0.11.0

func Tracer(ctx context.Context) trace.Tracer

func TrimErrPathPrefix added in v0.19.10

func TrimErrPathPrefix(err error, prefix string) error

TrimErrPathPrefix will trim a prefix from the path of an error, which is useful for both removing buildkit mount root paths and referencing uncleaned paths

func UpdateWorkspaceLock added in v0.21.0

func UpdateWorkspaceLock(ctx context.Context, query *Query, lock *workspace.Lock) error

UpdateWorkspaceLock refreshes the existing entries in a workspace lockfile in place.

func ValidateFileName added in v0.21.0

func ValidateFileName(file string) error

func WalkEnv added in v0.6.0

func WalkEnv(env []string, fn func(string, string, string))

WalkEnv iterates over all environment variables with parsed key and value, and original string.

Types

type Address added in v0.18.19

type Address struct {
	Value string
}

func (*Address) Type added in v0.18.19

func (*Address) Type() *ast.Type

func (*Address) TypeDescription added in v0.18.19

func (*Address) TypeDescription() string

type AddressID added in v0.18.19

type AddressID = dagql.ID[*Address]

type AfterVersion added in v0.18.11

type AfterVersion string

AfterVersion is a view that checks if a target version is greater than *or* equal to the filtered version.

func (AfterVersion) Contains added in v0.18.11

func (minVersion AfterVersion) Contains(version call.View) bool

type AliasSet added in v0.3.13

type AliasSet []string

func (AliasSet) String added in v0.3.13

func (set AliasSet) String() string

func (AliasSet) Union added in v0.8.5

func (set AliasSet) Union(other AliasSet) AliasSet

func (AliasSet) With added in v0.3.13

func (set AliasSet) With(alias string) AliasSet

type AnthropicClient added in v0.17.0

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

func (*AnthropicClient) IsRetryable added in v0.18.4

func (c *AnthropicClient) IsRetryable(err error) bool

func (*AnthropicClient) SendQuery added in v0.17.0

func (c *AnthropicClient) SendQuery(ctx context.Context, history []*ModelMessage, tools []LLMTool) (res *LLMResponse, rerr error)

type BeforeVersion added in v0.18.11

type BeforeVersion string

BeforeVersion is a view that checks if a target version is less than the filtered version.

func (BeforeVersion) Contains added in v0.18.11

func (maxVersion BeforeVersion) Contains(version call.View) bool

type Binding added in v0.18.0

type Binding struct {
	Key         string
	Value       dagql.Typed
	Description string
	// The expected type
	// Used when defining an output
	ExpectedType string
}

func (*Binding) AsList added in v0.18.0

func (b *Binding) AsList() (dagql.Enumerable, bool)

func (*Binding) AsObject added in v0.18.0

func (b *Binding) AsObject() (dagql.AnyObjectResult, bool)

func (*Binding) AsString added in v0.18.0

func (b *Binding) AsString() (string, bool)

func (*Binding) Clone added in v0.18.4

func (b *Binding) Clone() *Binding

func (*Binding) Digest added in v0.18.0

func (b *Binding) Digest() digest.Digest

Return a stable digest of the binding's value

func (*Binding) ID added in v0.18.0

func (b *Binding) ID() string

Return the stable object ID for this binding, or an empty string if it's not an object

func (*Binding) String added in v0.18.0

func (b *Binding) String() string

Return a string representation of the binding value

func (*Binding) Type added in v0.18.0

func (*Binding) Type() *ast.Type

func (*Binding) TypeName added in v0.18.0

func (b *Binding) TypeName() string

type BuildArg added in v0.3.8

type BuildArg struct {
	Name  string `field:"true" doc:"The build argument name."`
	Value string `field:"true" doc:"The build argument value."`
}

func (BuildArg) TypeDescription added in v0.9.7

func (BuildArg) TypeDescription() string

func (BuildArg) TypeName added in v0.9.7

func (BuildArg) TypeName() string

type CacheMountSource added in v0.18.18

type CacheMountSource struct {
	// The cache volume backing this mount.
	Volume dagql.ObjectResult[*CacheVolume]
}

type CacheSharingMode added in v0.3.12

type CacheSharingMode string

func (CacheSharingMode) Decoder added in v0.9.7

func (mode CacheSharingMode) Decoder() dagql.InputDecoder

func (CacheSharingMode) MarshalJSON added in v0.9.0

func (mode CacheSharingMode) MarshalJSON() ([]byte, error)

CacheSharingMode marshals to its lowercased value.

NB: as far as I can recall this is purely for ~*aesthetic*~. GraphQL consts are so shouty!

func (CacheSharingMode) ToLiteral added in v0.9.7

func (mode CacheSharingMode) ToLiteral() call.Literal

func (CacheSharingMode) Type added in v0.9.7

func (mode CacheSharingMode) Type() *ast.Type

func (CacheSharingMode) TypeDescription added in v0.9.7

func (mode CacheSharingMode) TypeDescription() string

func (*CacheSharingMode) UnmarshalJSON added in v0.9.0

func (mode *CacheSharingMode) UnmarshalJSON(payload []byte) error

CacheSharingMode marshals to its lowercased value.

NB: as far as I can recall this is purely for ~*aesthetic*~. GraphQL consts are so shouty!

type CacheVolume

type CacheVolume struct {
	Key       string
	Namespace string
	Source    dagql.Optional[DirectoryID]
	Sharing   CacheSharingMode
	Owner     string
	// contains filtered or unexported fields
}

CacheVolume is a persistent volume with a globally scoped identifier.

func NewCache

func NewCache(
	key string,
	namespace string,
	source dagql.Optional[DirectoryID],
	sharing CacheSharingMode,
	owner string,
) *CacheVolume

func (*CacheVolume) CacheUsageIdentities added in v0.21.0

func (cache *CacheVolume) CacheUsageIdentities() []string

func (*CacheVolume) CacheUsageMayChange added in v0.21.0

func (cache *CacheVolume) CacheUsageMayChange() bool

func (*CacheVolume) CacheUsageSize added in v0.21.0

func (cache *CacheVolume) CacheUsageSize(ctx context.Context, identity string) (int64, bool, error)

func (*CacheVolume) DecodePersistedObject added in v0.21.0

func (*CacheVolume) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*CacheVolume) EncodePersistedObject added in v0.21.0

func (cache *CacheVolume) EncodePersistedObject(ctx context.Context, persistedCache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*CacheVolume) InitializeSnapshot added in v0.21.0

func (cache *CacheVolume) InitializeSnapshot(ctx context.Context) error

func (*CacheVolume) OnRelease added in v0.21.0

func (cache *CacheVolume) OnRelease(ctx context.Context) error
func (cache *CacheVolume) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*CacheVolume) Sync added in v0.21.0

func (cache *CacheVolume) Sync(ctx context.Context) error

func (*CacheVolume) Type added in v0.9.7

func (*CacheVolume) Type() *ast.Type

func (*CacheVolume) TypeDescription added in v0.9.7

func (*CacheVolume) TypeDescription() string

type CacheVolumeID added in v0.9.0

type CacheVolumeID = dagql.ID[*CacheVolume]

type CallInput added in v0.8.8

type CallInput struct {
	Name  string
	Value dagql.Typed
}

type CallOpts added in v0.9.7

type CallOpts struct {
	Inputs         []CallInput
	ParentTyped    dagql.AnyResult
	ParentFields   map[string]any
	SkipSelfSchema bool
	Server         *dagql.Server
}

type Callable added in v0.9.7

type Callable interface {
	Call(context.Context, *CallOpts) (dagql.AnyResult, error)
	ReturnType() (ModType, error)
	ArgType(argName string) (ModType, error)
	DynamicInputsForCall(context.Context, dagql.AnyResult, map[string]dagql.Input, call.View, *dagql.CallRequest) error
}

type CallableField added in v0.9.7

type CallableField struct {
	Module *Module
	Field  *FieldTypeDef
	Return ModType
}

func (*CallableField) ArgType added in v0.9.7

func (f *CallableField) ArgType(argName string) (ModType, error)

func (*CallableField) Call added in v0.9.7

func (f *CallableField) Call(ctx context.Context, opts *CallOpts) (dagql.AnyResult, error)

func (*CallableField) DynamicInputsForCall added in v0.21.0

func (f *CallableField) DynamicInputsForCall(
	ctx context.Context,
	parent dagql.AnyResult,
	args map[string]dagql.Input,
	view call.View,
	req *dagql.CallRequest,
) error

func (*CallableField) ReturnType added in v0.9.7

func (f *CallableField) ReturnType() (ModType, error)

type CallerStatFS added in v0.18.7

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

func NewCallerStatFS added in v0.18.7

func NewCallerStatFS(bk *engineutil.Client) *CallerStatFS

func (CallerStatFS) Exists added in v0.20.4

func (csfs CallerStatFS) Exists(ctx context.Context, path string) (string, bool, error)

func (CallerStatFS) Stat added in v0.18.7

func (csfs CallerStatFS) Stat(ctx context.Context, path string) (string, *Stat, error)

type ChainedCall added in v0.18.8

type ChainedCall struct {
	Method string         `json:"method"`
	Args   map[string]any `json:"args"`
}

type ChangeType added in v0.19.11

type ChangeType int
const (
	ChangeTypeAdded ChangeType = iota
	ChangeTypeModified
	ChangeTypeRemoved
)

type Changeset added in v0.18.18

type Changeset struct {
	Before dagql.ObjectResult[*Directory] `field:"true" doc:"The older/lower snapshot to compare against."`
	After  dagql.ObjectResult[*Directory] `field:"true" doc:"The newer/upper snapshot."`
	// contains filtered or unexported fields
}

func NewChangeset added in v0.18.18

func NewChangeset(ctx context.Context, before, after dagql.ObjectResult[*Directory]) (*Changeset, error)

func NewEmptyChangeset added in v0.19.11

func NewEmptyChangeset(ctx context.Context) (*Changeset, error)

NewEmptyChangeset creates a changeset with no changes (before and after are the same empty directory).

func (*Changeset) AsPatch added in v0.18.18

func (ch *Changeset) AsPatch(ctx context.Context) (*File, error)

func (*Changeset) AttachDependencyResults added in v0.21.0

func (ch *Changeset) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*Changeset) ComputePaths added in v0.19.9

func (ch *Changeset) ComputePaths(ctx context.Context) (*ChangesetPaths, error)

ComputePaths computes the added, modified, and removed paths using git diff.

func (*Changeset) DecodePersistedObject added in v0.21.0

func (*Changeset) DecodePersistedObject(
	ctx context.Context,
	dag *dagql.Server,
	_ uint64,
	_ *dagql.ResultCall,
	payload json.RawMessage,
) (dagql.Typed, error)

func (*Changeset) DiffStats added in v0.20.4

func (ch *Changeset) DiffStats(ctx context.Context) ([]*DiffStat, error)

func (*Changeset) EncodePersistedObject added in v0.21.0

func (ch *Changeset) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Changeset) Evaluate added in v0.18.18

func (ch *Changeset) Evaluate(context.Context) error

func (*Changeset) Export added in v0.18.19

func (ch *Changeset) Export(ctx context.Context, destPath string) (rerr error)

func (*Changeset) IsEmpty added in v0.19.9

func (ch *Changeset) IsEmpty(ctx context.Context) (bool, error)

func (*Changeset) MarshalJSON added in v0.19.11

func (ch *Changeset) MarshalJSON() ([]byte, error)

MarshalJSON implements custom JSON marshaling that stores directory IDs

func (*Changeset) ResolveRefs added in v0.19.11

func (ch *Changeset) ResolveRefs(ctx context.Context, srv *dagql.Server) error

ResolveRefs must be called after JSON unmarshaling to fully reconstruct the Changeset.

func (*Changeset) Sync added in v0.21.0

func (ch *Changeset) Sync(ctx context.Context) error

func (*Changeset) Type added in v0.18.18

func (*Changeset) Type() *ast.Type

func (*Changeset) TypeDescription added in v0.18.18

func (*Changeset) TypeDescription() string

func (*Changeset) UnmarshalJSON added in v0.19.11

func (ch *Changeset) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshaling that stores IDs for later resolution

func (*Changeset) WithChangeset added in v0.19.11

func (ch *Changeset) WithChangeset(
	ctx context.Context,
	other *Changeset,
	onConflictStrategy WithChangesetMergeConflict,
) (*Changeset, error)

WithChangeset merges another changeset into this one using git-based 3-way merge. The onConflictStrategy determines how conflicts are handled:

  • FailEarlyOnConflict: fail before merge if file-level conflicts are detected
  • FailOnConflict: attempt merge, fail if git merge fails
  • LeaveConflictMarkers: let git create conflict markers, keep modified for modify/delete
  • PreferOursOnConflict: use -X ours strategy
  • PreferTheirsOnConflict: use -X theirs strategy

func (*Changeset) WithChangesets added in v0.19.11

func (ch *Changeset) WithChangesets(
	ctx context.Context,
	others []*Changeset,
	onConflictStrategy WithChangesetsMergeConflict,
) (*Changeset, error)

WithChangesets merges multiple changesets into this one using git's octopus merge strategy. The onConflictStrategy determines how conflicts are handled:

  • FailEarlyOnConflicts: fail before merge if file-level conflicts are detected
  • FailOnConflicts: attempt merge, fail if git merge fails

type ChangesetPaths added in v0.19.9

type ChangesetPaths struct {
	Added      []string
	Modified   []string
	Removed    []string
	AllRemoved []string
	Renamed    map[string]string // newPath → oldPath (also included in Added/Removed)
}

func (*ChangesetPaths) CheckConflicts added in v0.19.11

func (ch *ChangesetPaths) CheckConflicts(other *ChangesetPaths) Conflicts

CheckConflicts detects conflicts using pre-computed path sets for O(1) lookups

type Check added in v0.19.7

type Check struct {
	Node      *ModTreeNode `json:"node"`
	Completed bool         `field:"true" doc:"Whether the check completed"`
	Passed    bool         `field:"true" doc:"Whether the check passed"`

	Error dagql.Nullable[dagql.ObjectResult[*Error]] `field:"true" doc:"If the check failed, this is the error"`

	// IsGenerate indicates this check was derived from a +generate function.
	// When true, the check passes if the generator produces an empty changeset.
	IsGenerate bool
}

Check represents a validation check with its result

func (*Check) CheckType added in v0.21.0

func (c *Check) CheckType() string

func (*Check) Clone added in v0.19.7

func (c *Check) Clone() *Check

func (*Check) Description added in v0.19.7

func (c *Check) Description() string

func (*Check) Name added in v0.19.7

func (c *Check) Name() string

func (*Check) OriginalModule added in v0.20.0

func (c *Check) OriginalModule() *Module

func (*Check) Path added in v0.19.7

func (c *Check) Path() []string

func (*Check) ResultEmoji added in v0.19.7

func (c *Check) ResultEmoji() string

func (*Check) Run added in v0.19.7

func (c *Check) Run(ctx context.Context) (*Check, error)

func (*Check) Type added in v0.19.7

func (*Check) Type() *ast.Type

type CheckGroup added in v0.19.7

type CheckGroup struct {
	Node   *ModTreeNode `json:"node"`
	Checks []*Check     `json:"checks"`
}

func NewCheckGroup added in v0.19.11

func NewCheckGroup(ctx context.Context, mod dagql.ObjectResult[*Module], include []string, noGenerate bool) (*CheckGroup, error)

func (*CheckGroup) Clone added in v0.19.7

func (r *CheckGroup) Clone() *CheckGroup

func (*CheckGroup) List added in v0.19.7

func (r *CheckGroup) List() []*Check

func (*CheckGroup) Report added in v0.19.7

func (r *CheckGroup) Report(ctx context.Context) (dagql.ObjectResult[*File], error)

func (*CheckGroup) Run added in v0.19.7

func (r *CheckGroup) Run(ctx context.Context, failFast bool) (*CheckGroup, error)

Run all the checks in the group

func (*CheckGroup) Type added in v0.19.7

func (*CheckGroup) Type() *ast.Type

type ClientFilesyncMirror added in v0.21.0

type ClientFilesyncMirror struct {
	StableClientID string
	Drive          string
	EphemeralID    string
	// contains filtered or unexported fields
}

func NewEphemeralClientFilesyncMirror added in v0.21.0

func NewEphemeralClientFilesyncMirror(drive string) *ClientFilesyncMirror

func (*ClientFilesyncMirror) CacheUsageIdentities added in v0.21.0

func (m *ClientFilesyncMirror) CacheUsageIdentities() []string

func (*ClientFilesyncMirror) CacheUsageMayChange added in v0.21.0

func (m *ClientFilesyncMirror) CacheUsageMayChange() bool

func (*ClientFilesyncMirror) CacheUsageSize added in v0.21.0

func (m *ClientFilesyncMirror) CacheUsageSize(ctx context.Context, identity string) (int64, bool, error)

func (*ClientFilesyncMirror) DecodePersistedObject added in v0.21.0

func (*ClientFilesyncMirror) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*ClientFilesyncMirror) EncodePersistedObject added in v0.21.0

func (*ClientFilesyncMirror) EnsureCreated added in v0.21.0

func (m *ClientFilesyncMirror) EnsureCreated(ctx context.Context, query *Query) error

func (*ClientFilesyncMirror) OnRelease added in v0.21.0

func (m *ClientFilesyncMirror) OnRelease(ctx context.Context) error
func (m *ClientFilesyncMirror) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*ClientFilesyncMirror) Snapshot added in v0.21.0

func (m *ClientFilesyncMirror) Snapshot(
	ctx context.Context,
	query *Query,
	callerConn *grpc.ClientConn,
	clientPath string,
	opts filesync.SnapshotOpts,
) (bkcache.ImmutableRef, digest.Digest, error)

func (*ClientFilesyncMirror) Type added in v0.21.0

func (*ClientFilesyncMirror) Type() *ast.Type

func (*ClientFilesyncMirror) TypeDescription added in v0.21.0

func (*ClientFilesyncMirror) TypeDescription() string

type ClientGenerator added in v0.16.3

type ClientGenerator interface {
	/*
		RequiredClientGenerationFiles returns the list of files that are required
		from the host to generate the client.

		Note: this function is optional and may not be implemented by the SDK.
		It's only useful if the client generator needs files from the host while
		generating the client.

		This function prototype is different from the one exposed by the SDK.
		SDK MAY implement the `RequiredClientGenerationFiles` function with the
		following signature:

		“`gql
		  requiredClientGenerationFiles: [String]!
		““
	*/
	RequiredClientGenerationFiles(ctx context.Context) (dagql.Array[dagql.String], error)

	/*
		Generate client binding for the module and its dependencies at the given
		output directory. The generated client will be placed in the same directory
		as the module source root dir and contains bindings for all of the module's
		dependencies in addition to the core API and the module itself if it got
		source code.

		It's up to that function to update the source root directory with additional
		configurations if needed.
		For example (executing go mod tidy, updating tsconfig.json etc...)

		The generated client should use the published library version of the SDK.
		However, depending on the local configuration, a copy of the current SDK
		library should be copied to test the generated client with latest changes.
		NOTE: this should only be used for testing purposes.
		For example (if go.mod has a replace directive on dagger.io/dagger for a local path)

		This function prototype is different from the one exposed by the SDK.
		SDK must implement the `GenerateClient` function with the following signature:

		“`gql
		  generateClient(
			  modSource: ModuleSource!
			  introspectionJSON: File!
			  outputDir: String!
		  ): Directory!
		“`
	*/
	GenerateClient(
		context.Context,

		dagql.ObjectResult[*ModuleSource],

		dagql.Result[*File],

		string,
	) (dagql.ObjectResult[*Directory], error)
}

ClientGenerator is an interface that a module can implements to give client generation capabilities.

The generated client is standalone and can be used in any project, even if no source code module is available.

This interface MUST be implemented to support standalone client oriented features (`dagger client install`).

type Cloud added in v0.18.11

type Cloud struct {
}

func (*Cloud) Type added in v0.18.11

func (*Cloud) Type() *ast.Type

func (*Cloud) TypeDescription added in v0.18.11

func (*Cloud) TypeDescription() string

type CodeGenerator added in v0.18.7

type CodeGenerator interface {
	/*
		Codegen generates code for the module at the given source directory and
		subpath.

		The Code field of the returned GeneratedCode object should be the generated
		contents of the module sourceDirSubpath, in the case where that's different
		than the root of the sourceDir.

		The provided Module is not fully initialized; the Runtime field will not be
		set yet.

		This function prototype is different from the one exposed by the SDK.
		SDK must implement the `Codegen` function with the following signature:

		“`gql
		  codegen(
			  modSource: ModuleSource!
			  introspectionJSON: File!
		  ): GeneratedCode!
		“`
	*/
	Codegen(
		context.Context,

		*SchemaBuilder,

		dagql.ObjectResult[*ModuleSource],
	) (*GeneratedCode, error)
}

CodeGenerator is an interface that a SDK may implements to generate code for a module.

This can include multiple things, such as a generated client to interact with the Dagger Engine but also any changes in the module's code to run it in the Dagger Engine like dependency configuration, package manager settings etc...

This interface MUST be implemented to support language oriented SDKs (`dagger develop`).

type CollectedContent added in v0.20.0

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

CollectedContent accumulates a rolling content hash while walking a module function's value tree. The content hash is used to compute content-addressed cache keys for Workspace-aware functions.

func NewCollectedContent added in v0.20.0

func NewCollectedContent() *CollectedContent

func (*CollectedContent) CollectID added in v0.20.0

func (content *CollectedContent) CollectID(ctx context.Context, idp *call.ID, unknown bool) error

CollectID collects an ID, indicating whether it came from an unknown field.

func (*CollectedContent) CollectIndexed added in v0.20.0

func (content *CollectedContent) CollectIndexed(i int, value func() error) error

CollectIndexedUnknown hashes an unknown value, preceded by its array index and followed by a delimiter.

func (*CollectedContent) CollectJSONable added in v0.20.0

func (content *CollectedContent) CollectJSONable(value any) error

CollectJSONable content hashes a JSON-marshalble value.

func (*CollectedContent) CollectKeyed added in v0.20.0

func (content *CollectedContent) CollectKeyed(key string, value func() error) error

CollectKeyedUnknown hashes an unknown value, preceded by its map key and followed by a delimiter.

func (*CollectedContent) CollectUnknown added in v0.20.0

func (content *CollectedContent) CollectUnknown(ctx context.Context, value any) error

CollectUnknown naively walks a typically JSON-decoded value, e.g. from a module object's private field. It attempts to decode any strings it encounters into IDs, and hashes everything into the rolling content hash.

It is also used to content encode anything that is known to be JSONable.

func (*CollectedContent) Digest added in v0.20.0

func (content *CollectedContent) Digest() digest.Digest

Digest computes and finalizes the content digest.

type Conflict added in v0.19.11

type Conflict struct {
	Path  string
	Self  ChangeType
	Other ChangeType
	Err   error
}

type Conflicts added in v0.19.11

type Conflicts []Conflict

func (Conflicts) Error added in v0.19.11

func (conflicts Conflicts) Error() (err error)

func (Conflicts) IsEmpty added in v0.19.11

func (conflicts Conflicts) IsEmpty() bool

func (Conflicts) ModifyDeletePaths added in v0.19.11

func (conflicts Conflicts) ModifyDeletePaths() []string

type Container

type Container struct {
	// The container's root filesystem.
	FS *LazyAccessor[*Directory, *Container]

	// Image configuration (env, workdir, etc)
	Config dockerspec.DockerOCIImageConfig

	// List of GPU devices that will be exposed to the container
	EnabledGPUs []string

	// Mount points configured for the container.
	Mounts ContainerMounts

	// MetaSnapshot is the internal exec metadata snapshot containing stdout,
	// stderr, combined output, and exit code files. It will be nil if nothing
	// has run yet.
	MetaSnapshot *LazyAccessor[bkcache.ImmutableRef, *Container]

	// The platform of the container's rootfs.
	Platform Platform

	// OCI annotations
	Annotations []containerutil.ContainerAnnotation

	// Secrets to expose to the container.
	Secrets []ContainerSecret

	// Sockets to expose to the container.
	Sockets []ContainerSocket

	// Image reference
	ImageRef string

	// Ports to expose from the container.
	Ports []Port

	// Services to start before running the container.
	Services ServiceBindings

	// The args to invoke when using the terminal api on this container.
	DefaultTerminalCmd DefaultTerminalCmdOpts

	// (Internal-only for now) Environment variables from the engine container, prefixed
	// with a special value, that will be inherited by this container if set.
	SystemEnvNames []string

	// DefaultArgs have been explicitly set by the user
	DefaultArgs bool

	Lazy Lazy[*Container]
}

Container is a content-addressed container.

func BuiltInContainer added in v0.20.0

func BuiltInContainer(ctx context.Context, platform Platform, blobDigest string) (*Container, error)

func NewContainer added in v0.3.3

func NewContainer(platform Platform) *Container

func (*Container) AsService added in v0.15.0

func (container *Container) AsService(ctx context.Context, containerRes dagql.ObjectResult[*Container], args ContainerAsServiceArgs) (*Service, error)

func (*Container) AsTarball added in v0.9.0

func (container *Container) AsTarball(
	ctx context.Context,
	platformVariants []*Container,
	forcedCompression ImageLayerCompression,
	mediaTypes ImageMediaTypes,
	filePath string,
) (f *File, rerr error)

func (*Container) AttachDependencyResults added in v0.21.0

func (container *Container) AttachDependencyResults(
	ctx context.Context,
	self dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*Container) AttachDependencyResultsKinds added in v0.21.0

func (container *Container) AttachDependencyResultsKinds(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.DependencyResult, error)

func (*Container) Build

func (container *Container) Build(
	ctx context.Context,
	dockerfileDir dagql.ObjectResult[*Directory],

	contextDirID *call.ID,
	dockerfile string,
	buildArgs []BuildArg,
	target string,
	secrets []dagql.ObjectResult[*Secret],
	noInit bool,
	sshSocket dagql.ObjectResult[*Socket],
) (*Container, error)

func (*Container) CacheUsageIdentities added in v0.21.0

func (container *Container) CacheUsageIdentities() []string

func (*Container) CacheUsageSize added in v0.21.0

func (container *Container) CacheUsageSize(ctx context.Context, identity string) (int64, bool, error)

func (*Container) CombinedOutput added in v0.18.17

func (container *Container) CombinedOutput(ctx context.Context) (string, error)

func (*Container) DecodePersistedObject added in v0.21.0

func (*Container) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, call *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*Container) EncodePersistedObject added in v0.21.0

func (container *Container) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Container) Evaluate added in v0.3.13

func (container *Container) Evaluate(ctx context.Context) error

func (*Container) Exists added in v0.18.15

func (container *Container) Exists(ctx context.Context, parent dagql.ObjectResult[*Container], srv *dagql.Server, targetPath string, targetType ExistsType, doNotFollowSymlinks bool) (bool, error)

func (*Container) ExitCode

func (container *Container) ExitCode(ctx context.Context) (int, error)

func (*Container) Export added in v0.3.3

func (container *Container) Export(ctx context.Context, opts ExportOpts) (*specs.Descriptor, error)

func (*Container) FromCanonicalRef added in v0.13.6

func (container *Container) FromCanonicalRef(
	ctx context.Context,
	refName reference.Canonical,
) error

FromCanonicalRef resolves a digest-addressed image pull and updates only the rootfs snapshot state.

func (*Container) FromInternal added in v0.18.17

func (container *Container) FromInternal(
	ctx context.Context,
	desc specs.Descriptor,
) (*Container, error)

func (*Container) FromOCIStore added in v0.21.0

func (container *Container) FromOCIStore(
	ctx context.Context,
	manifestDesc specs.Descriptor,
	imageRef string,
) (*Container, error)

func (*Container) FromRefString added in v0.13.6

func (container *Container) FromRefString(ctx context.Context, addr string) (dagql.ObjectResult[*Container], error)

func (*Container) ImageConfig

func (container *Container) ImageConfig(ctx context.Context) (dockerspec.DockerOCIImageConfig, error)

func (*Container) ImageRefOrErr added in v0.5.1

func (container *Container) ImageRefOrErr(ctx context.Context) (string, error)

func (*Container) Import added in v0.5.0

func (container *Container) Import(
	ctx context.Context,
	tarball io.Reader,
	tag string,
) (*Container, error)

func (*Container) LazyEvalFunc added in v0.21.0

func (container *Container) LazyEvalFunc() dagql.LazyEvalFunc

func (*Container) MountTargets added in v0.5.1

func (container *Container) MountTargets(ctx context.Context) ([]string, error)

func (*Container) OnRelease added in v0.18.10

func (container *Container) OnRelease(ctx context.Context) error
func (container *Container) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*Container) Publish

func (container *Container) Publish(
	ctx context.Context,
	ref string,
	platformVariants []*Container,
	forcedCompression ImageLayerCompression,
	mediaTypes ImageMediaTypes,
) (string, error)

func (*Container) ResolveOwnership added in v0.21.0

func (container *Container) ResolveOwnership(ctx context.Context, parent dagql.ObjectResult[*Container], owner string) (string, error)

func (*Container) Stat added in v0.19.9

func (container *Container) Stat(ctx context.Context, parent dagql.ObjectResult[*Container], srv *dagql.Server, targetPath string, doNotFollowSymlinks bool) (*Stat, error)

func (*Container) Stderr added in v0.12.5

func (container *Container) Stderr(ctx context.Context) (string, error)

func (*Container) Stdout added in v0.12.5

func (container *Container) Stdout(ctx context.Context) (string, error)

func (*Container) Sync added in v0.21.0

func (container *Container) Sync(ctx context.Context) error

func (*Container) Terminal added in v0.9.8

func (container *Container) Terminal(
	ctx context.Context,
	selectedID *call.ID,
	selectedDigest digest.Digest,
	containerRes dagql.ObjectResult[*Container],
	args *TerminalArgs,
) error

func (*Container) TerminalExecError added in v0.21.0

func (container *Container) TerminalExecError(
	ctx context.Context,
	selectedID *call.ID,
	selectedDigest digest.Digest,
	containerRes dagql.ObjectResult[*Container],
	execMD *engineutil.ExecutionMetadata,
	execMeta *executor.Meta,
	execErr error,
) error

func (*Container) Type added in v0.9.7

func (*Container) Type() *ast.Type

func (*Container) TypeDescription added in v0.9.7

func (*Container) TypeDescription() string

func (*Container) UpdateImageConfig

func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(dockerspec.DockerOCIImageConfig) dockerspec.DockerOCIImageConfig) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithAnnotation added in v0.13.1

func (container *Container) WithAnnotation(ctx context.Context, key, value string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithDirectory added in v0.3.7

func (container *Container) WithDirectory(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	subdir string,
	src dagql.ObjectResult[*Directory],
	filter CopyFilter,
	owner string,
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithExec added in v0.3.13

func (container *Container) WithExec(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	opts ContainerExecOpts,
	execMD *engineutil.ExecutionMetadata,
	moduleContext dagql.ObjectResult[*Module],
	functionCall *FunctionCall,
	extractModuleError bool,
) error

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithExposedPort added in v0.3.13

func (container *Container) WithExposedPort(port Port) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithFile added in v0.3.7

func (container *Container) WithFile(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	destPath string,
	src dagql.ObjectResult[*File],
	permissions *int,
	owner string,
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithFiles added in v0.9.10

func (container *Container) WithFiles(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	destDir string,
	src []dagql.ObjectResult[*File],
	permissions *int,
	owner string,
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithGPU added in v0.9.2

func (container *Container) WithGPU(ctx context.Context, gpuOpts ContainerGPUOpts) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithMountedCache

func (container *Container) WithMountedCache(
	ctx context.Context,
	target string,
	cache dagql.ObjectResult[*CacheVolume],
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithMountedDirectory

func (container *Container) WithMountedDirectory(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	target string,
	dir dagql.ObjectResult[*Directory],
	owner string,
	readonly bool,
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithMountedFile

func (container *Container) WithMountedFile(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	target string,
	file dagql.ObjectResult[*File],
	owner string,
	readonly bool,
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithMountedSecret

func (container *Container) WithMountedSecret(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	target string,
	source dagql.ObjectResult[*Secret],
	owner string,
	mode fs.FileMode,
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithMountedTemp

func (container *Container) WithMountedTemp(ctx context.Context, target string, size int) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithNewFile added in v0.3.7

func (container *Container) WithNewFile(
	ctx context.Context,
	parent dagql.ObjectResult[*Container],
	dest string,
	content []byte,
	permissions fs.FileMode,
	owner string,
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithRootFS added in v0.3.5

func (container *Container) WithRootFS(ctx context.Context, dir dagql.ObjectResult[*Directory]) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithSecretVariable

func (container *Container) WithSecretVariable(
	ctx context.Context,
	name string,
	secret dagql.ObjectResult[*Secret],
) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithServiceBinding added in v0.5.0

func (container *Container) WithServiceBinding(ctx context.Context, svc dagql.ObjectResult[*Service], alias string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (container *Container) WithSymlink(ctx context.Context, parent dagql.ObjectResult[*Container], target, linkPath string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithUnixSocket added in v0.3.7

func (container *Container) WithUnixSocket(ctx context.Context, target string, source dagql.ObjectResult[*Socket], owner string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithUnixSocketFromParent added in v0.21.0

func (container *Container) WithUnixSocketFromParent(ctx context.Context, parent dagql.ObjectResult[*Container], target string, source dagql.ObjectResult[*Socket], owner string) (*Container, error)

func (*Container) WithoutAnnotation added in v0.13.1

func (container *Container) WithoutAnnotation(ctx context.Context, name string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithoutExposedPort added in v0.3.13

func (container *Container) WithoutExposedPort(port int, protocol NetworkProtocol) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithoutMount

func (container *Container) WithoutMount(ctx context.Context, target string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithoutPaths added in v0.13.1

func (container *Container) WithoutPaths(ctx context.Context, parent dagql.ObjectResult[*Container], destPaths ...string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithoutSecretVariable added in v0.11.3

func (container *Container) WithoutSecretVariable(ctx context.Context, name string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

func (*Container) WithoutUnixSocket added in v0.3.7

func (container *Container) WithoutUnixSocket(ctx context.Context, target string) (*Container, error)

mutates container caller must have handled cloning or creating a new child.

type ContainerAsServiceArgs added in v0.15.0

type ContainerAsServiceArgs struct {
	// Command to run instead of the container's default command
	Args []string `default:"[]"`

	// If the container has an entrypoint, prepend it to this exec's args
	UseEntrypoint bool `default:"false"`

	// Provide the executed command access back to the Dagger API
	ExperimentalPrivilegedNesting bool `default:"false"`

	// Grant the process all root capabilities
	InsecureRootCapabilities bool `default:"false"`

	// Expand the environment variables in args
	Expand bool `default:"false"`

	// Skip the init process injected into containers by default so that the
	// user's process is PID 1
	NoInit bool `default:"false"`
}

type ContainerDirectoryLazy added in v0.21.0

type ContainerDirectoryLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Path   string
}

func (*ContainerDirectoryLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerDirectoryLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerDirectoryLazy) EncodePersisted added in v0.21.0

func (*ContainerDirectoryLazy) Evaluate added in v0.21.0

func (lazy *ContainerDirectoryLazy) Evaluate(ctx context.Context, dir *Directory) error

type ContainerExecLazy added in v0.21.0

type ContainerExecLazy struct {
	State *ContainerExecState
}

func (*ContainerExecLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerExecLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerExecLazy) EncodePersisted added in v0.21.0

func (lazy *ContainerExecLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*ContainerExecLazy) Evaluate added in v0.21.0

func (lazy *ContainerExecLazy) Evaluate(ctx context.Context, ctr *Container) error

type ContainerExecOpts

type ContainerExecOpts struct {
	// Command to run instead of the container's default command
	Args []string

	// If the container has an entrypoint, prepend it to this exec's args
	UseEntrypoint bool `default:"false"`

	// Content to write to the command's standard input before closing
	Stdin string `default:""`
	// Redirect the command's standard input from a file in the container
	RedirectStdin string `default:""`

	// Redirect the command's standard output to a file in the container
	RedirectStdout string `default:""`

	// Redirect the command's standard error to a file in the container
	RedirectStderr string `default:""`

	// Exit codes this exec is allowed to exit with
	Expect ReturnTypes `default:"SUCCESS"`

	// Provide the executed command access back to the Dagger API
	ExperimentalPrivilegedNesting bool `default:"false"`

	// Grant the process all root capabilities
	InsecureRootCapabilities bool `default:"false"`

	// (Internal-only) execute with no network connectivity, equivalent to
	// BuildKit NetMode_NONE / Dockerfile RUN --network=none.
	NoNetwork bool `internal:"true" default:"false"`

	// (Internal-only) execute with host networking, equivalent to
	// BuildKit NetMode_HOST / Dockerfile RUN --network=host.
	HostNetwork bool `internal:"true" default:"false"`

	// Expand the environment variables in args
	Expand bool `default:"false"`

	// Skip the init process injected into containers by default so that the
	// user's process is PID 1
	NoInit bool `default:"false"`
}

type ContainerExecState added in v0.21.0

type ContainerExecState struct {
	LazyState

	Parent             dagql.ObjectResult[*Container]
	Opts               ContainerExecOpts
	ExecMD             *engineutil.ExecutionMetadata
	ModuleContext      dagql.ObjectResult[*Module]
	FunctionCall       *FunctionCall
	ExtractModuleError bool
}

func (*ContainerExecState) Evaluate added in v0.21.0

func (state *ContainerExecState) Evaluate(ctx context.Context, container *Container) (rerr error)

type ContainerFileLazy added in v0.21.0

type ContainerFileLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Path   string
}

func (*ContainerFileLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerFileLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerFileLazy) EncodePersisted added in v0.21.0

func (lazy *ContainerFileLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*ContainerFileLazy) Evaluate added in v0.21.0

func (lazy *ContainerFileLazy) Evaluate(ctx context.Context, file *File) error

type ContainerFromImageRefLazy added in v0.21.0

type ContainerFromImageRefLazy struct {
	LazyState
	Parent       dagql.ObjectResult[*Container]
	CanonicalRef string
	Config       dockerspec.DockerOCIImageConfig
	ImageRef     string
	Platform     Platform
	ResolveMode  serverresolver.ResolveMode
}

func (*ContainerFromImageRefLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerFromImageRefLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerFromImageRefLazy) EncodePersisted added in v0.21.0

func (*ContainerFromImageRefLazy) Evaluate added in v0.21.0

func (lazy *ContainerFromImageRefLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerGPUOpts added in v0.9.2

type ContainerGPUOpts struct {
	Devices []string
}

type ContainerID

type ContainerID = dagql.ID[*Container]

type ContainerImportLazy added in v0.21.0

type ContainerImportLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Source dagql.ObjectResult[*File]
	Tag    string
}

func (*ContainerImportLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerImportLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerImportLazy) EncodePersisted added in v0.21.0

func (lazy *ContainerImportLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*ContainerImportLazy) Evaluate added in v0.21.0

func (lazy *ContainerImportLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerMount

type ContainerMount struct {
	// The path of the mount within the container.
	Target string

	// Configure the mount as read-only.
	Readonly bool

	// The mounted directory.
	DirectorySource *LazyAccessor[*Directory, *Container]
	// The mounted file.
	FileSource *LazyAccessor[*File, *Container]
	// The mounted cache.
	CacheSource *CacheMountSource
	// The mounted tmpfs.
	TmpfsSource *TmpfsMountSource
}

ContainerMount is a mount point configured in a container.

type ContainerMounts added in v0.3.3

type ContainerMounts []ContainerMount

func CloneContainerMounts added in v0.21.0

func CloneContainerMounts(ctx context.Context, mounts ContainerMounts) (ContainerMounts, error)

func (ContainerMounts) Replace added in v0.18.10

func (mnts ContainerMounts) Replace(newMnt ContainerMount) (ContainerMounts, error)

func (ContainerMounts) With added in v0.3.3

type ContainerRootFSLazy added in v0.21.0

type ContainerRootFSLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
}

func (*ContainerRootFSLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerRootFSLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerRootFSLazy) EncodePersisted added in v0.21.0

func (lazy *ContainerRootFSLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*ContainerRootFSLazy) Evaluate added in v0.21.0

func (lazy *ContainerRootFSLazy) Evaluate(ctx context.Context, dir *Directory) error

type ContainerRuntime added in v0.20.2

type ContainerRuntime struct {
	Container dagql.ObjectResult[*Container]
}

ContainerRuntime wraps a Container to serve as a ModuleRuntime.

func (*ContainerRuntime) AsContainer added in v0.20.2

func (r *ContainerRuntime) AsContainer() (dagql.ObjectResult[*Container], bool)

func (*ContainerRuntime) Call added in v0.20.2

func (r *ContainerRuntime) Call(
	ctx context.Context,
	execMD *engineutil.ExecutionMetadata,
	fnCall *FunctionCall,
	moduleContext dagql.ObjectResult[*Module],
	envContext dagql.ObjectResult[*Env],
) ([]byte, error)

type ContainerSecret

type ContainerSecret struct {
	Secret    dagql.ObjectResult[*Secret]
	EnvName   string
	MountPath string
	Owner     *Ownership
	Mode      fs.FileMode
}

ContainerSecret configures a secret to expose, either as an environment variable or mounted to a file path.

type ContainerSetGPUsLazy added in v0.21.0

type ContainerSetGPUsLazy struct {
	LazyState
	Parent  dagql.ObjectResult[*Container]
	Devices []string
}

func (*ContainerSetGPUsLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerSetGPUsLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerSetGPUsLazy) EncodePersisted added in v0.21.0

func (lazy *ContainerSetGPUsLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*ContainerSetGPUsLazy) Evaluate added in v0.21.0

func (lazy *ContainerSetGPUsLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerSocket added in v0.3.7

type ContainerSocket struct {
	Source        dagql.ObjectResult[*Socket]
	ContainerPath string
	Owner         *Ownership
}

ContainerSocket configures a socket to expose, currently as a Unix socket, but potentially as a TCP or UDP address in the future.

type ContainerWithAnnotationLazy added in v0.21.0

type ContainerWithAnnotationLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
	Value  string
}

func (*ContainerWithAnnotationLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithAnnotationLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithAnnotationLazy) EncodePersisted added in v0.21.0

func (*ContainerWithAnnotationLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithAnnotationLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithDefaultArgsLazy added in v0.21.0

type ContainerWithDefaultArgsLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Args   []string
}

func (*ContainerWithDefaultArgsLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithDefaultArgsLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithDefaultArgsLazy) EncodePersisted added in v0.21.0

func (*ContainerWithDefaultArgsLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithDefaultArgsLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithDefaultTerminalCmdLazy added in v0.21.0

type ContainerWithDefaultTerminalCmdLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Opts   DefaultTerminalCmdOpts
}

func (*ContainerWithDefaultTerminalCmdLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithDefaultTerminalCmdLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithDefaultTerminalCmdLazy) EncodePersisted added in v0.21.0

func (*ContainerWithDefaultTerminalCmdLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithDefaultTerminalCmdLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithDirectoryLazy added in v0.21.0

type ContainerWithDirectoryLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Path   string
	Source dagql.ObjectResult[*Directory]
	Filter CopyFilter
	Owner  string
}

func (*ContainerWithDirectoryLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithDirectoryLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithDirectoryLazy) EncodePersisted added in v0.21.0

func (*ContainerWithDirectoryLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithDirectoryLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithEntrypointLazy added in v0.21.0

type ContainerWithEntrypointLazy struct {
	LazyState
	Parent          dagql.ObjectResult[*Container]
	Args            []string
	KeepDefaultArgs bool
}

func (*ContainerWithEntrypointLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithEntrypointLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithEntrypointLazy) EncodePersisted added in v0.21.0

func (*ContainerWithEntrypointLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithEntrypointLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithEnvFileVariablesLazy added in v0.21.0

type ContainerWithEnvFileVariablesLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Source dagql.ObjectResult[*EnvFile]
}

func (*ContainerWithEnvFileVariablesLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithEnvFileVariablesLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithEnvFileVariablesLazy) EncodePersisted added in v0.21.0

func (*ContainerWithEnvFileVariablesLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithEnvFileVariablesLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithEnvVariableLazy added in v0.21.0

type ContainerWithEnvVariableLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
	Value  string
	Expand bool
}

func (*ContainerWithEnvVariableLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithEnvVariableLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithEnvVariableLazy) EncodePersisted added in v0.21.0

func (*ContainerWithEnvVariableLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithEnvVariableLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithExposedPortLazy added in v0.21.0

type ContainerWithExposedPortLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Port   Port
}

func (*ContainerWithExposedPortLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithExposedPortLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithExposedPortLazy) EncodePersisted added in v0.21.0

func (*ContainerWithExposedPortLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithExposedPortLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithFileLazy added in v0.21.0

type ContainerWithFileLazy struct {
	LazyState
	Parent      dagql.ObjectResult[*Container]
	Path        string
	Source      dagql.ObjectResult[*File]
	Permissions *int
	Owner       string
}

func (*ContainerWithFileLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithFileLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithFileLazy) EncodePersisted added in v0.21.0

func (lazy *ContainerWithFileLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*ContainerWithFileLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithFileLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithHealthcheckLazy added in v0.21.0

type ContainerWithHealthcheckLazy struct {
	LazyState
	Parent      dagql.ObjectResult[*Container]
	Healthcheck dockerspec.HealthcheckConfig
}

func (*ContainerWithHealthcheckLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithHealthcheckLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithHealthcheckLazy) EncodePersisted added in v0.21.0

func (*ContainerWithHealthcheckLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithHealthcheckLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithImageConfigMetadataLazy added in v0.21.0

type ContainerWithImageConfigMetadataLazy struct {
	LazyState
	Parent      dagql.ObjectResult[*Container]
	Healthcheck *dockerspec.HealthcheckConfig
	OnBuild     []string
	Shell       []string
	Volumes     []string
	StopSignal  string
}

func (*ContainerWithImageConfigMetadataLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithImageConfigMetadataLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithImageConfigMetadataLazy) EncodePersisted added in v0.21.0

func (*ContainerWithImageConfigMetadataLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithImageConfigMetadataLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithLabelLazy added in v0.21.0

type ContainerWithLabelLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
	Value  string
}

func (*ContainerWithLabelLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithLabelLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithLabelLazy) EncodePersisted added in v0.21.0

func (*ContainerWithLabelLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithLabelLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithMountedCacheLazy added in v0.21.0

type ContainerWithMountedCacheLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Target string
	Cache  dagql.ObjectResult[*CacheVolume]
}

func (*ContainerWithMountedCacheLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithMountedCacheLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithMountedCacheLazy) EncodePersisted added in v0.21.0

func (*ContainerWithMountedCacheLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithMountedCacheLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithMountedDirectoryLazy added in v0.21.0

type ContainerWithMountedDirectoryLazy struct {
	LazyState
	Parent   dagql.ObjectResult[*Container]
	Target   string
	Source   dagql.ObjectResult[*Directory]
	Owner    string
	Readonly bool
}

func (*ContainerWithMountedDirectoryLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithMountedDirectoryLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithMountedDirectoryLazy) EncodePersisted added in v0.21.0

func (*ContainerWithMountedDirectoryLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithMountedDirectoryLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithMountedFileLazy added in v0.21.0

type ContainerWithMountedFileLazy struct {
	LazyState
	Parent   dagql.ObjectResult[*Container]
	Target   string
	Source   dagql.ObjectResult[*File]
	Owner    string
	Readonly bool
}

func (*ContainerWithMountedFileLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithMountedFileLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithMountedFileLazy) EncodePersisted added in v0.21.0

func (*ContainerWithMountedFileLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithMountedFileLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithMountedSecretLazy added in v0.21.0

type ContainerWithMountedSecretLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Target string
	Source dagql.ObjectResult[*Secret]
	Owner  string
	Mode   fs.FileMode
}

func (*ContainerWithMountedSecretLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithMountedSecretLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithMountedSecretLazy) EncodePersisted added in v0.21.0

func (*ContainerWithMountedSecretLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithMountedSecretLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithMountedTempLazy added in v0.21.0

type ContainerWithMountedTempLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Target string
	Size   int
}

func (*ContainerWithMountedTempLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithMountedTempLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithMountedTempLazy) EncodePersisted added in v0.21.0

func (*ContainerWithMountedTempLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithMountedTempLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithRootFSLazy added in v0.21.0

type ContainerWithRootFSLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Source dagql.ObjectResult[*Directory]
}

func (*ContainerWithRootFSLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithRootFSLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithRootFSLazy) EncodePersisted added in v0.21.0

func (*ContainerWithRootFSLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithRootFSLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithSecretVariableLazy added in v0.21.0

type ContainerWithSecretVariableLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
	Secret dagql.ObjectResult[*Secret]
}

func (*ContainerWithSecretVariableLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithSecretVariableLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithSecretVariableLazy) EncodePersisted added in v0.21.0

func (*ContainerWithSecretVariableLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithSecretVariableLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithServiceBindingLazy added in v0.21.0

type ContainerWithServiceBindingLazy struct {
	LazyState
	Parent  dagql.ObjectResult[*Container]
	Service dagql.ObjectResult[*Service]
	Alias   string
}

func (*ContainerWithServiceBindingLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithServiceBindingLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithServiceBindingLazy) EncodePersisted added in v0.21.0

func (*ContainerWithServiceBindingLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithServiceBindingLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithSymlinkLazy added in v0.21.0

type ContainerWithSymlinkLazy struct {
	LazyState
	Parent   dagql.ObjectResult[*Container]
	Target   string
	LinkPath string
}

func (*ContainerWithSymlinkLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithSymlinkLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithSymlinkLazy) EncodePersisted added in v0.21.0

func (*ContainerWithSymlinkLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithSymlinkLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithSystemEnvVariableLazy added in v0.21.0

type ContainerWithSystemEnvVariableLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
}

func (*ContainerWithSystemEnvVariableLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithSystemEnvVariableLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithSystemEnvVariableLazy) EncodePersisted added in v0.21.0

func (*ContainerWithSystemEnvVariableLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithSystemEnvVariableLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithUnixSocketLazy added in v0.21.0

type ContainerWithUnixSocketLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Target string
	Source dagql.ObjectResult[*Socket]
	Owner  string
}

func (*ContainerWithUnixSocketLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithUnixSocketLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithUnixSocketLazy) EncodePersisted added in v0.21.0

func (*ContainerWithUnixSocketLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithUnixSocketLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithUserLazy added in v0.21.0

type ContainerWithUserLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
}

func (*ContainerWithUserLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithUserLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithUserLazy) EncodePersisted added in v0.21.0

func (lazy *ContainerWithUserLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*ContainerWithUserLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithUserLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithWorkdirLazy added in v0.21.0

type ContainerWithWorkdirLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Path   string
	Expand bool
}

func (*ContainerWithWorkdirLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithWorkdirLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithWorkdirLazy) EncodePersisted added in v0.21.0

func (*ContainerWithWorkdirLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithWorkdirLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutAnnotationLazy added in v0.21.0

type ContainerWithoutAnnotationLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
}

func (*ContainerWithoutAnnotationLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutAnnotationLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutAnnotationLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutAnnotationLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutAnnotationLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutDefaultArgsLazy added in v0.21.0

type ContainerWithoutDefaultArgsLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
}

func (*ContainerWithoutDefaultArgsLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutDefaultArgsLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutDefaultArgsLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutDefaultArgsLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutDefaultArgsLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutEntrypointLazy added in v0.21.0

type ContainerWithoutEntrypointLazy struct {
	LazyState
	Parent          dagql.ObjectResult[*Container]
	KeepDefaultArgs bool
}

func (*ContainerWithoutEntrypointLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutEntrypointLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutEntrypointLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutEntrypointLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutEntrypointLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutEnvVariableLazy added in v0.21.0

type ContainerWithoutEnvVariableLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
}

func (*ContainerWithoutEnvVariableLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutEnvVariableLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutEnvVariableLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutEnvVariableLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutEnvVariableLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutExposedPortLazy added in v0.21.0

type ContainerWithoutExposedPortLazy struct {
	LazyState
	Parent   dagql.ObjectResult[*Container]
	Port     int
	Protocol NetworkProtocol
}

func (*ContainerWithoutExposedPortLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutExposedPortLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutExposedPortLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutExposedPortLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutExposedPortLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutHealthcheckLazy added in v0.21.0

type ContainerWithoutHealthcheckLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
}

func (*ContainerWithoutHealthcheckLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutHealthcheckLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutHealthcheckLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutHealthcheckLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutHealthcheckLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutLabelLazy added in v0.21.0

type ContainerWithoutLabelLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
}

func (*ContainerWithoutLabelLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutLabelLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutLabelLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutLabelLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutLabelLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutMountLazy added in v0.21.0

type ContainerWithoutMountLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Target string
}

func (*ContainerWithoutMountLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutMountLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutMountLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutMountLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutMountLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutPathLazy added in v0.21.0

type ContainerWithoutPathLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Path   string
}

func (*ContainerWithoutPathLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutPathLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutPathLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutPathLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutPathLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutSecretVariableLazy added in v0.21.0

type ContainerWithoutSecretVariableLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Name   string
}

func (*ContainerWithoutSecretVariableLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutSecretVariableLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutSecretVariableLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutSecretVariableLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutSecretVariableLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutUnixSocketLazy added in v0.21.0

type ContainerWithoutUnixSocketLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
	Target string
}

func (*ContainerWithoutUnixSocketLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutUnixSocketLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutUnixSocketLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutUnixSocketLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutUnixSocketLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutUserLazy added in v0.21.0

type ContainerWithoutUserLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
}

func (*ContainerWithoutUserLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutUserLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutUserLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutUserLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutUserLazy) Evaluate(ctx context.Context, container *Container) error

type ContainerWithoutWorkdirLazy added in v0.21.0

type ContainerWithoutWorkdirLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Container]
}

func (*ContainerWithoutWorkdirLazy) AttachDependencies added in v0.21.0

func (lazy *ContainerWithoutWorkdirLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*ContainerWithoutWorkdirLazy) EncodePersisted added in v0.21.0

func (*ContainerWithoutWorkdirLazy) Evaluate added in v0.21.0

func (lazy *ContainerWithoutWorkdirLazy) Evaluate(ctx context.Context, container *Container) error

type CopyFilter added in v0.3.3

type CopyFilter struct {
	Exclude   []string `default:"[]"`
	Include   []string `default:"[]"`
	Gitignore bool     `default:"false"`
}

func (*CopyFilter) IsEmpty added in v0.19.3

func (cf *CopyFilter) IsEmpty() bool

type CurrentModule added in v0.9.8

type CurrentModule struct {
	Module dagql.ObjectResult[*Module]
}

func (CurrentModule) Clone added in v0.9.8

func (mod CurrentModule) Clone() *CurrentModule

func (*CurrentModule) Type added in v0.9.8

func (*CurrentModule) Type() *ast.Type

func (*CurrentModule) TypeDescription added in v0.9.8

func (*CurrentModule) TypeDescription() string

type DefaultTerminalCmdOpts added in v0.10.1

type DefaultTerminalCmdOpts struct {
	Args []string

	// Provide dagger access to the executed command
	ExperimentalPrivilegedNesting dagql.Optional[dagql.Boolean] `default:"false"`

	// Grant the process all root capabilities
	InsecureRootCapabilities dagql.Optional[dagql.Boolean] `default:"false"`
}

type DiffStat added in v0.20.4

type DiffStat struct {
	Path         string       `field:"true" doc:"Path of the changed file or directory."`
	OldPath      *string      `field:"true" doc:"Previous path of the file, set only for renames."`
	Kind         DiffStatKind `field:"true" doc:"Type of change."`
	AddedLines   int          `field:"true" doc:"Number of added lines for this path."`
	RemovedLines int          `field:"true" doc:"Number of removed lines for this path."`
}

func (*DiffStat) DecodePersistedObject added in v0.21.0

func (*DiffStat) DecodePersistedObject(_ context.Context, _ *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*DiffStat) EncodePersistedObject added in v0.21.0

func (*DiffStat) Type added in v0.20.4

func (*DiffStat) Type() *ast.Type

type DiffStatKind added in v0.20.4

type DiffStatKind string

func (DiffStatKind) Decoder added in v0.20.4

func (DiffStatKind) Decoder() dagql.InputDecoder

func (DiffStatKind) ToLiteral added in v0.20.4

func (k DiffStatKind) ToLiteral() call.Literal

func (DiffStatKind) Type added in v0.20.4

func (DiffStatKind) Type() *ast.Type

func (DiffStatKind) TypeDescription added in v0.20.4

func (DiffStatKind) TypeDescription() string

type DirModuleSource added in v0.19.7

type DirModuleSource struct {
	// the original dir that AsModuleSource was called on
	OriginalContextDir dagql.ObjectResult[*Directory]
	// the original source root subpath provided to AsModuleSource
	OriginalSourceRootSubpath string
}

type Directory

type Directory struct {
	Platform Platform
	// Services necessary to provision the directory.
	Services ServiceBindings

	Lazy     Lazy[*Directory]
	Dir      *LazyAccessor[string, *Directory] // a selected subdir of the rootfs of the on-disk Result, if any
	Snapshot *LazyAccessor[bkcache.ImmutableRef, *Directory]
}

Directory is a content-addressed directory.

func (*Directory) AttachDependencyResults added in v0.21.0

func (dir *Directory) AttachDependencyResults(
	ctx context.Context,
	self dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*Directory) AttachDependencyResultsKinds added in v0.21.0

func (dir *Directory) AttachDependencyResultsKinds(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.DependencyResult, error)

func (*Directory) CacheUsageIdentities added in v0.21.0

func (dir *Directory) CacheUsageIdentities() []string

func (*Directory) CacheUsageSize added in v0.21.0

func (dir *Directory) CacheUsageSize(ctx context.Context, identity string) (int64, bool, error)

func (*Directory) Chown added in v0.18.18

func (dir *Directory) Chown(ctx context.Context, parent dagql.ObjectResult[*Directory], chownPath string, owner string) error

func (*Directory) DecodePersistedObject added in v0.21.0

func (*Directory) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*Directory) Diff

func (*Directory) Digest added in v0.5.2

func (dir *Directory) Digest(ctx context.Context, self dagql.ObjectResult[*Directory]) (string, error)

func (*Directory) EncodePersistedObject added in v0.21.0

func (dir *Directory) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Directory) Entries

func (dir *Directory) Entries(ctx context.Context, self dagql.ObjectResult[*Directory], src string) ([]string, error)

func (*Directory) Exists added in v0.18.15

func (dir *Directory) Exists(ctx context.Context, self dagql.ObjectResult[*Directory], srv *dagql.Server, targetPath string, targetType ExistsType, doNotFollowSymlinks bool) (bool, error)

func (*Directory) Export added in v0.3.3

func (dir *Directory) Export(ctx context.Context, self dagql.ObjectResult[*Directory], destPath string, merge bool) (rerr error)

func (*Directory) Glob added in v0.9.1

func (dir *Directory) Glob(ctx context.Context, self dagql.ObjectResult[*Directory], pattern string) ([]string, error)

Glob returns a list of files that matches the given pattern.

func (*Directory) LazyEvalFunc added in v0.21.0

func (dir *Directory) LazyEvalFunc() dagql.LazyEvalFunc

func (*Directory) Mount added in v0.18.13

func (dir *Directory) Mount(ctx context.Context, self dagql.ObjectResult[*Directory], f func(string) error) error

func (*Directory) OnRelease added in v0.16.3

func (dir *Directory) OnRelease(ctx context.Context) error
func (dir *Directory) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*Directory) Search added in v0.18.17

func (dir *Directory) Search(ctx context.Context, self dagql.ObjectResult[*Directory], opts SearchOpts, verbose bool, paths []string, globs []string) ([]*SearchResult, error)

func (*Directory) Stat

func (dir *Directory) Stat(ctx context.Context, self dagql.ObjectResult[*Directory], srv *dagql.Server, targetPath string, doNotFollowSymlinks bool) (*Stat, error)

func (*Directory) Subdirectory added in v0.21.0

func (dir *Directory) Subdirectory(ctx context.Context, parent dagql.ObjectResult[*Directory], subdir string) (*Directory, error)

func (*Directory) Subfile added in v0.21.0

func (dir *Directory) Subfile(ctx context.Context, parent dagql.ObjectResult[*Directory], file string) (*File, error)

func (*Directory) Terminal added in v0.12.0

func (dir *Directory) Terminal(
	ctx context.Context,
	selectedID *call.ID,
	selectedDigest digest.Digest,
	ctr dagql.ObjectResult[*Container],
	args *TerminalArgs,
	parent dagql.ObjectResult[*Directory],
) error

func (*Directory) Type added in v0.9.7

func (*Directory) Type() *ast.Type

func (*Directory) TypeDescription added in v0.9.7

func (*Directory) TypeDescription() string

func (*Directory) WithChanges added in v0.18.18

func (dir *Directory) WithChanges(ctx context.Context, parent dagql.ObjectResult[*Directory], changes dagql.ObjectResult[*Changeset]) error

func (*Directory) WithDirectory

func (dir *Directory) WithDirectory(
	ctx context.Context,
	parent dagql.ObjectResult[*Directory],
	destDir string,
	src dagql.ObjectResult[*Directory],
	filter CopyFilter,
	owner string,
	permissions *int,
) error

func (*Directory) WithDirectoryDockerfileCompat added in v0.21.0

func (dir *Directory) WithDirectoryDockerfileCompat(
	ctx context.Context,
	parent dagql.ObjectResult[*Directory],
	destDir string,
	srcPath string,
	src dagql.ObjectResult[*Directory],
	filter CopyFilter,
	owner string,
	permissions *int,
	_ bool,
	_ bool,
	attemptUnpackDockerCompatibility bool,
	createDestPath bool,
	_ bool,
	_ bool,
	_ bool,
) error

func (*Directory) WithFile added in v0.3.3

func (dir *Directory) WithFile(
	ctx context.Context,
	parent dagql.ObjectResult[*Directory],
	destPath string,
	src dagql.ObjectResult[*File],
	permissions *int,
	owner string,
	doNotCreateDestPath bool,
	attemptUnpackDockerCompatibility bool,
) error

func (*Directory) WithNewDirectory added in v0.3.3

func (dir *Directory) WithNewDirectory(ctx context.Context, parent dagql.ObjectResult[*Directory], dest string, permissions fs.FileMode) error

func (*Directory) WithNewFile

func (dir *Directory) WithNewFile(ctx context.Context, parent dagql.ObjectResult[*Directory], dest string, content []byte, permissions fs.FileMode, ownership *Ownership) error
func (dir *Directory) WithSymlink(ctx context.Context, parent dagql.ObjectResult[*Directory], target, linkName string) error

func (*Directory) WithTimestamps added in v0.3.8

func (dir *Directory) WithTimestamps(ctx context.Context, parent dagql.ObjectResult[*Directory], unix int) error

func (*Directory) Without

func (dir *Directory) Without(ctx context.Context, parent dagql.ObjectResult[*Directory], opCall *dagql.ResultCall, teachNoopEquivalence bool, paths ...string) error

type DirectoryChownLazy added in v0.21.0

type DirectoryChownLazy struct {
	LazyState
	Parent    dagql.ObjectResult[*Directory]
	ChownPath string
	Owner     string
}

func (*DirectoryChownLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryChownLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryChownLazy) EncodePersisted added in v0.21.0

func (lazy *DirectoryChownLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*DirectoryChownLazy) Evaluate added in v0.21.0

func (lazy *DirectoryChownLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryDiffLazy added in v0.21.0

type DirectoryDiffLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Directory]
	Other  dagql.ObjectResult[*Directory]
}

func (*DirectoryDiffLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryDiffLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryDiffLazy) EncodePersisted added in v0.21.0

func (lazy *DirectoryDiffLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*DirectoryDiffLazy) Evaluate added in v0.21.0

func (lazy *DirectoryDiffLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryID

type DirectoryID = dagql.ID[*Directory]

type DirectoryStatFS added in v0.20.4

type DirectoryStatFS struct {
	Dir dagql.ObjectResult[*Directory]
}

DirectoryStatFS implements StatFS over a dagql Directory.

func (*DirectoryStatFS) Exists added in v0.20.4

func (dfs *DirectoryStatFS) Exists(ctx context.Context, path string) (string, bool, error)

func (*DirectoryStatFS) Stat added in v0.20.4

func (dfs *DirectoryStatFS) Stat(ctx context.Context, path string) (string, *Stat, error)

type DirectorySubdirectoryLazy added in v0.21.0

type DirectorySubdirectoryLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Directory]
	Subdir string
}

func (*DirectorySubdirectoryLazy) AttachDependencies added in v0.21.0

func (lazy *DirectorySubdirectoryLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectorySubdirectoryLazy) EncodePersisted added in v0.21.0

func (*DirectorySubdirectoryLazy) Evaluate added in v0.21.0

func (lazy *DirectorySubdirectoryLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithChangesLazy added in v0.21.0

type DirectoryWithChangesLazy struct {
	LazyState
	Parent  dagql.ObjectResult[*Directory]
	Changes dagql.ObjectResult[*Changeset]
}

func (*DirectoryWithChangesLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithChangesLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithChangesLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithChangesLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithChangesLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithDirectoryDockerfileCompatLazy added in v0.21.0

type DirectoryWithDirectoryDockerfileCompatLazy struct {
	LazyState
	Parent                           dagql.ObjectResult[*Directory]
	DestDir                          string
	SrcPath                          string
	Source                           dagql.ObjectResult[*Directory]
	Filter                           CopyFilter
	Owner                            string
	Permissions                      *int
	FollowSymlink                    bool
	DirCopyContents                  bool
	AttemptUnpackDockerCompatibility bool
	CreateDestPath                   bool
	AllowWildcard                    bool
	AllowEmptyWildcard               bool
	AlwaysReplaceExistingDestPaths   bool
}

func (*DirectoryWithDirectoryDockerfileCompatLazy) AttachDependencies added in v0.21.0

func (*DirectoryWithDirectoryDockerfileCompatLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithDirectoryDockerfileCompatLazy) Evaluate added in v0.21.0

type DirectoryWithDirectoryLazy added in v0.21.0

type DirectoryWithDirectoryLazy struct {
	LazyState
	Parent      dagql.ObjectResult[*Directory]
	DestDir     string
	Source      dagql.ObjectResult[*Directory]
	Filter      CopyFilter
	Owner       string
	Permissions *int
}

func (*DirectoryWithDirectoryLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithDirectoryLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithDirectoryLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithDirectoryLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithDirectoryLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithFileLazy added in v0.21.0

type DirectoryWithFileLazy struct {
	LazyState
	Parent                           dagql.ObjectResult[*Directory]
	DestPath                         string
	Source                           dagql.ObjectResult[*File]
	Permissions                      *int
	Owner                            string
	DoNotCreateDestPath              bool
	AttemptUnpackDockerCompatibility bool
}

func (*DirectoryWithFileLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithFileLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithFileLazy) EncodePersisted added in v0.21.0

func (lazy *DirectoryWithFileLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*DirectoryWithFileLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithFileLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithNewDirectoryLazy added in v0.21.0

type DirectoryWithNewDirectoryLazy struct {
	LazyState
	Parent      dagql.ObjectResult[*Directory]
	Dest        string
	Permissions fs.FileMode
}

func (*DirectoryWithNewDirectoryLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithNewDirectoryLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithNewDirectoryLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithNewDirectoryLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithNewDirectoryLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithNewFileLazy added in v0.21.0

type DirectoryWithNewFileLazy struct {
	LazyState
	Parent      dagql.ObjectResult[*Directory]
	Dest        string
	Content     []byte
	Permissions fs.FileMode
	Ownership   *Ownership
}

func (*DirectoryWithNewFileLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithNewFileLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithNewFileLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithNewFileLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithNewFileLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithPatchFileLazy added in v0.21.0

type DirectoryWithPatchFileLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Directory]
	Patch  dagql.ObjectResult[*File]
}

func (*DirectoryWithPatchFileLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithPatchFileLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithPatchFileLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithPatchFileLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithPatchFileLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithSymlinkLazy added in v0.21.0

type DirectoryWithSymlinkLazy struct {
	LazyState
	Parent   dagql.ObjectResult[*Directory]
	Target   string
	LinkName string
}

func (*DirectoryWithSymlinkLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithSymlinkLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithSymlinkLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithSymlinkLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithSymlinkLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithTimestampsLazy added in v0.21.0

type DirectoryWithTimestampsLazy struct {
	LazyState
	Parent    dagql.ObjectResult[*Directory]
	Timestamp int
}

func (*DirectoryWithTimestampsLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithTimestampsLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithTimestampsLazy) EncodePersisted added in v0.21.0

func (*DirectoryWithTimestampsLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithTimestampsLazy) Evaluate(ctx context.Context, dir *Directory) error

type DirectoryWithoutLazy added in v0.21.0

type DirectoryWithoutLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Directory]
	Paths  []string
}

func (*DirectoryWithoutLazy) AttachDependencies added in v0.21.0

func (lazy *DirectoryWithoutLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*DirectoryWithoutLazy) EncodePersisted added in v0.21.0

func (lazy *DirectoryWithoutLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*DirectoryWithoutLazy) Evaluate added in v0.21.0

func (lazy *DirectoryWithoutLazy) Evaluate(ctx context.Context, dir *Directory) error

type DynamicID added in v0.9.7

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

func (DynamicID) DecodeInput added in v0.9.7

func (d DynamicID) DecodeInput(val any) (dagql.Input, error)

func (DynamicID) Decoder added in v0.9.7

func (d DynamicID) Decoder() dagql.InputDecoder

func (DynamicID) ID added in v0.9.7

func (d DynamicID) ID() (*call.ID, error)

ID returns the ID of the value.

func (DynamicID) MarshalJSON added in v0.9.7

func (d DynamicID) MarshalJSON() ([]byte, error)

func (DynamicID) ToLiteral added in v0.9.7

func (d DynamicID) ToLiteral() call.Literal

func (DynamicID) Type added in v0.9.7

func (d DynamicID) Type() *ast.Type

func (DynamicID) TypeName added in v0.9.7

func (d DynamicID) TypeName() string

type Engine added in v0.12.0

type Engine struct {
	Name string `field:"true" doc:"The name of the engine instance."`
}

func (*Engine) Type added in v0.12.0

func (*Engine) Type() *ast.Type

func (*Engine) TypeDescription added in v0.12.0

func (*Engine) TypeDescription() string

type EngineCache added in v0.12.0

type EngineCache struct {
	MaxUsedSpace  int `field:"true" doc:"The maximum bytes to keep in the cache without pruning."`
	TargetSpace   int `field:"true" doc:"The target number of bytes to keep when pruning."`
	ReservedSpace int `field:"true" doc:"The minimum amount of disk space this policy is guaranteed to retain."`
	MinFreeSpace  int `field:"true" doc:"The target amount of free disk space the garbage collector will attempt to leave."`
}

func (*EngineCache) Type added in v0.12.0

func (*EngineCache) Type() *ast.Type

func (*EngineCache) TypeDescription added in v0.12.0

func (*EngineCache) TypeDescription() string

type EngineCacheEntry added in v0.12.0

type EngineCacheEntry struct {
	Description               string   `field:"true" doc:"The description of the cache entry."`
	DiskSpaceBytes            int      `field:"true" doc:"The disk space used by the cache entry."`
	CreatedTimeUnixNano       int      `field:"true" doc:"The time the cache entry was created, in Unix nanoseconds."`
	MostRecentUseTimeUnixNano int      `field:"true" doc:"The most recent time the cache entry was used, in Unix nanoseconds."`
	ActivelyUsed              bool     `field:"true" doc:"Whether the cache entry is actively being used."`
	RecordType                string   `` /* 135-byte string literal not displayed */
	RecordTypes               []string `field:"true" doc:"The storage record types represented by this cache entry."`
	DagqlCall                 string   `field:"true" doc:"The DagQL call that produced this cache entry."`
}

func (*EngineCacheEntry) Type added in v0.12.0

func (*EngineCacheEntry) Type() *ast.Type

func (*EngineCacheEntry) TypeDescription added in v0.12.0

func (*EngineCacheEntry) TypeDescription() string

type EngineCacheEntrySet added in v0.12.0

type EngineCacheEntrySet struct {
	EntryCount     int `field:"true" doc:"The number of cache entries in this set."`
	DiskSpaceBytes int `field:"true" doc:"The total disk space used by the cache entries in this set."`

	EntriesList []*EngineCacheEntry
}

func (*EngineCacheEntrySet) Evaluate added in v0.12.0

func (*EngineCacheEntrySet) Sync added in v0.21.0

func (entrySet *EngineCacheEntrySet) Sync(ctx context.Context) error

func (*EngineCacheEntrySet) Type added in v0.12.0

func (*EngineCacheEntrySet) Type() *ast.Type

func (*EngineCacheEntrySet) TypeDescription added in v0.12.0

func (*EngineCacheEntrySet) TypeDescription() string

type EngineCachePruneOptions added in v0.20.0

type EngineCachePruneOptions struct {
	UseDefaultPolicy bool
	MaxUsedSpace     string
	ReservedSpace    string
	MinFreeSpace     string
	TargetSpace      string
}

type EnumMemberTypeDef added in v0.18.11

type EnumMemberTypeDef struct {
	Name        string                                         `field:"true" doc:"The name of the enum member." doNotCache:"simple field selection"`
	Value       string                                         `field:"true" doc:"The value of the enum member" doNotCache:"simple field selection"`
	Description string                                         `field:"true" doc:"A doc string for the enum member, if any." doNotCache:"simple field selection"`
	SourceMap   dagql.Nullable[dagql.ObjectResult[*SourceMap]] `field:"true" doc:"The location of this enum member declaration."`
	Deprecated  *string                                        `field:"true" doc:"The reason this enum member is deprecated, if any."`

	OriginalName string
}

func NewEnumMemberTypeDef added in v0.18.11

func NewEnumMemberTypeDef(name, value, description string, deprecated *string, sourceMap dagql.ObjectResult[*SourceMap]) *EnumMemberTypeDef

func NewEnumValueTypeDef added in v0.12.0

func NewEnumValueTypeDef(name, value, description string, deprecated *string, sourceMap dagql.ObjectResult[*SourceMap]) *EnumMemberTypeDef

func (*EnumMemberTypeDef) AttachDependencyResults added in v0.21.0

func (enumValue *EnumMemberTypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (EnumMemberTypeDef) Clone added in v0.18.11

func (enumValue EnumMemberTypeDef) Clone() *EnumMemberTypeDef

func (*EnumMemberTypeDef) DecodePersistedObject added in v0.21.0

func (*EnumMemberTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*EnumMemberTypeDef) EncodePersistedObject added in v0.21.0

func (enumValue *EnumMemberTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*EnumMemberTypeDef) EnumValueDirectives added in v0.18.11

func (enumValue *EnumMemberTypeDef) EnumValueDirectives() []*ast.Directive

func (*EnumMemberTypeDef) Type added in v0.18.11

func (*EnumMemberTypeDef) Type() *ast.Type

func (*EnumMemberTypeDef) TypeDescription added in v0.18.11

func (*EnumMemberTypeDef) TypeDescription() string

func (*EnumMemberTypeDef) WithName added in v0.21.0

func (enumValue *EnumMemberTypeDef) WithName(name string) *EnumMemberTypeDef

func (*EnumMemberTypeDef) WithSourceMap added in v0.21.0

func (enumValue *EnumMemberTypeDef) WithSourceMap(sourceMap dagql.ObjectResult[*SourceMap]) *EnumMemberTypeDef

type EnumMemberTypeDefID added in v0.21.0

type EnumMemberTypeDefID = dagql.ID[*EnumMemberTypeDef]

type EnumTypeDef added in v0.12.0

type EnumTypeDef struct {
	// Name is the standardized name of the enum (CamelCase), as used for the enum in the graphql schema
	Name        string `field:"true" doc:"The name of the enum." doNotCache:"simple field selection"`
	Description string `field:"true" doc:"A doc string for the enum, if any." doNotCache:"simple field selection"`
	Members     dagql.ObjectResultArray[*EnumMemberTypeDef]
	SourceMap   dagql.Nullable[dagql.ObjectResult[*SourceMap]] `field:"true" doc:"The location of this enum declaration."`

	// SourceModuleName is currently only set when returning the TypeDef from the Enum field on Module
	SourceModuleName string `` /* 144-byte string literal not displayed */

	// The original name of the enum as provided by the SDK that defined it, used
	// when invoking the SDK so it doesn't need to think as hard about case conversions
	OriginalName string
}

func NewEnumTypeDef added in v0.12.0

func NewEnumTypeDef(name, description string, sourceMap dagql.ObjectResult[*SourceMap]) *EnumTypeDef

func (*EnumTypeDef) AttachDependencyResults added in v0.21.0

func (enum *EnumTypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (EnumTypeDef) Clone added in v0.12.0

func (enum EnumTypeDef) Clone() *EnumTypeDef

func (*EnumTypeDef) DecodePersistedObject added in v0.21.0

func (*EnumTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*EnumTypeDef) EncodePersistedObject added in v0.21.0

func (enum *EnumTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*EnumTypeDef) Type added in v0.12.0

func (*EnumTypeDef) Type() *ast.Type

func (*EnumTypeDef) TypeDescription added in v0.12.0

func (*EnumTypeDef) TypeDescription() string

func (*EnumTypeDef) WithMember added in v0.21.0

func (enum *EnumTypeDef) WithMember(member dagql.ObjectResult[*EnumMemberTypeDef]) (*EnumTypeDef, error)

func (*EnumTypeDef) WithName added in v0.21.0

func (enum *EnumTypeDef) WithName(name string) *EnumTypeDef

func (*EnumTypeDef) WithSourceMap added in v0.21.0

func (enum *EnumTypeDef) WithSourceMap(sourceMap dagql.ObjectResult[*SourceMap]) *EnumTypeDef

func (*EnumTypeDef) WithSourceModuleName added in v0.21.0

func (enum *EnumTypeDef) WithSourceModuleName(sourceModuleName string) *EnumTypeDef

type EnumTypeDefID added in v0.21.0

type EnumTypeDefID = dagql.ID[*EnumTypeDef]

type Env added in v0.18.0

type Env struct {
	// The environment's host filesystem
	Workspace dagql.ObjectResult[*Directory] `field:"true"`

	// The main module for this environment (the project being worked on)
	MainModule dagql.ObjectResult[*Module]
	// contains filtered or unexported fields
}

func NewEnv added in v0.18.0

func NewEnv(workspace dagql.ObjectResult[*Directory], deps *SchemaBuilder) *Env

func (*Env) Check added in v0.19.11

func (env *Env) Check(ctx context.Context, name string) (*Check, error)

Check returns a single check by name from the main module

func (*Env) Checks added in v0.19.11

func (env *Env) Checks(ctx context.Context, include []string, noGenerate bool) (*CheckGroup, error)

Checks returns a CheckGroup from the main module

func (*Env) Clone added in v0.18.0

func (env *Env) Clone() *Env

func (*Env) Input added in v0.18.0

func (env *Env) Input(key string) (*Binding, bool)

Lookup registered outputs in the environment

func (*Env) Inputs added in v0.18.0

func (env *Env) Inputs() []*Binding

List all inputs in the environment

func (*Env) IsPrivileged added in v0.18.8

func (env *Env) IsPrivileged() bool

func (*Env) Output added in v0.18.0

func (env *Env) Output(key string) (*Binding, bool)

Lookup registered outputs in the environment

func (*Env) Outputs added in v0.18.0

func (env *Env) Outputs() []*Binding

List all outputs in the environment

func (*Env) Privileged added in v0.18.8

func (env *Env) Privileged() *Env

func (*Env) Services added in v0.20.4

func (env *Env) Services(ctx context.Context, include []string) (*UpGroup, error)

Services returns an UpGroup from the main module

func (*Env) Type added in v0.18.0

func (*Env) Type() *ast.Type

func (*Env) WithInput added in v0.18.0

func (env *Env) WithInput(key string, val dagql.Typed, description string) *Env

Add an input (read-only) binding to the environment

func (*Env) WithMainModule added in v0.19.11

func (env *Env) WithMainModule(mod dagql.ObjectResult[*Module]) *Env

func (*Env) WithModule added in v0.19.0

func (env *Env) WithModule(mod dagql.ObjectResult[*Module]) *Env

func (*Env) WithOutput added in v0.18.0

func (env *Env) WithOutput(key string, expectedType dagql.Type, description string) *Env

Register the desire for a binding in the environment

func (*Env) WithWorkspace added in v0.19.0

func (env *Env) WithWorkspace(dir dagql.ObjectResult[*Directory]) *Env

func (*Env) WithoutInput added in v0.18.0

func (env *Env) WithoutInput(key string) *Env

Remove an input

func (*Env) WithoutOutputs added in v0.19.0

func (env *Env) WithoutOutputs() *Env

Remove all outputs from the environment and prevent new ones from being declared

func (*Env) Writable added in v0.18.4

func (env *Env) Writable() *Env

Return a writable copy of the environment

type EnvFile added in v0.18.18

type EnvFile struct {
	// Variables stored as key-value pairs, preserving order and allowing duplicates
	Environ []string `json:"variables"`
	Expand  bool     `json:"expand"`
}

EnvFile represents a collection of environment variables that can be manipulated

func NewEnvFile added in v0.19.1

func NewEnvFile(expand bool) *EnvFile

func (*EnvFile) AsFile added in v0.18.18

func (ef *EnvFile) AsFile(ctx context.Context) (dagql.ObjectResult[*File], error)

AsFile converts the EnvFile to a File containing the environment variables.

func (*EnvFile) Clone added in v0.18.18

func (ef *EnvFile) Clone() *EnvFile

Clone creates a deep copy of the EnvFile

func (*EnvFile) Digest added in v0.19.8

func (ef *EnvFile) Digest(ctx context.Context) (digest.Digest, error)

func (*EnvFile) Exists added in v0.18.18

func (ef *EnvFile) Exists(name string) bool

Return true if the variable exists

func (*EnvFile) Len added in v0.19.1

func (ef *EnvFile) Len() int

Len returns the number of variables in the EnvFile

func (*EnvFile) Lookup added in v0.18.18

func (ef *EnvFile) Lookup(ctx context.Context, name string, raw bool) (string, bool, error)

Lookup a variable and return its value, and a 'found' boolean

func (*EnvFile) LookupCaseInsensitive added in v0.19.1

func (ef *EnvFile) LookupCaseInsensitive(ctx context.Context, name string) (string, bool, error)

func (*EnvFile) Namespace added in v0.19.1

func (ef *EnvFile) Namespace(ctx context.Context, prefix string) (*EnvFile, error)

Filters variables by prefix and removes the prefix from keys.

Variables without the prefix are excluded. For example, with the prefix "MY_APP_" and variables:

MY_APP_TOKEN=topsecret
MY_APP_NAME=hello
FOO=bar

the resulting environment will contain:

TOKEN=topsecret
NAME=hello

func (*EnvFile) Type added in v0.18.18

func (*EnvFile) Type() *ast.Type

func (*EnvFile) TypeDescription added in v0.18.18

func (*EnvFile) TypeDescription() string

func (*EnvFile) Variables added in v0.18.18

func (ef *EnvFile) Variables(ctx context.Context, raw bool) ([]EnvVariable, error)

Variables returns all variables

func (*EnvFile) WithContents added in v0.18.18

func (ef *EnvFile) WithContents(contents string) (*EnvFile, error)

WithContents parses the given contents using joho/godotenv and appends variables via EnvFile.WithVariable. Order/duplicates are not preserved.

func (*EnvFile) WithEnvFiles added in v0.19.1

func (ef *EnvFile) WithEnvFiles(others ...*EnvFile) *EnvFile

WithVariables adds multiple environment variables to the EnvFile

func (*EnvFile) WithVariable added in v0.18.18

func (ef *EnvFile) WithVariable(name, value string) *EnvFile

WithVariable adds a new environment variable to the EnvFile

func (*EnvFile) WithVariables added in v0.19.1

func (ef *EnvFile) WithVariables(variables []EnvVariable) *EnvFile

func (*EnvFile) WithoutVariable added in v0.18.18

func (ef *EnvFile) WithoutVariable(name string) *EnvFile

WithoutVariable removes all occurrences of the named variable

type EnvFileID added in v0.19.8

type EnvFileID = dagql.ID[*EnvFile]

type EnvHook added in v0.18.0

type EnvHook struct {
	Server *dagql.Server
}

A Dagql hook for dynamically extending the Environment and Binding types based on available types

func (EnvHook) ExtendEnvType added in v0.18.0

func (s EnvHook) ExtendEnvType(targetType dagql.ObjectType, directives ...*ast.Directive) error

func (EnvHook) ForkInstallHook added in v0.21.0

func (s EnvHook) ForkInstallHook(server *dagql.Server) dagql.InstallHook

func (EnvHook) InstallObject added in v0.18.0

func (s EnvHook) InstallObject(targetType dagql.ObjectType, directives ...*ast.Directive)

func (EnvHook) ModuleWithObject added in v0.18.0

func (s EnvHook) ModuleWithObject(ctx context.Context, mod *Module, targetTypedef dagql.ObjectResult[*TypeDef]) (*Module, error)

type EnvID added in v0.18.0

type EnvID = dagql.ID[*Env]

type EnvVariable added in v0.18.18

type EnvVariable struct {
	Name  string `field:"true" doc:"The environment variable name."`
	Value string `field:"true" doc:"The environment variable value."`
}

func (EnvVariable) Description added in v0.18.18

func (EnvVariable) Description() string

func (EnvVariable) Type added in v0.18.18

func (EnvVariable) Type() *ast.Type

func (EnvVariable) TypeDescription added in v0.18.18

func (EnvVariable) TypeDescription() string

type EnvVariables added in v0.19.8

type EnvVariables []EnvVariable

func (EnvVariables) Sort added in v0.19.8

func (e EnvVariables) Sort()

type Error added in v0.15.0

type Error struct {
	Message string        `field:"true" doc:"A description of the error."`
	Values  []*ErrorValue `field:"true" doc:"The extensions of the error."`
}

func NewError added in v0.15.0

func NewError(message string) *Error

func (*Error) Clone added in v0.18.11

func (e *Error) Clone() *Error

func (*Error) Error added in v0.17.0

func (e *Error) Error() string

func (*Error) Extensions added in v0.17.0

func (e *Error) Extensions() map[string]any

func (*Error) Type added in v0.15.0

func (e *Error) Type() *ast.Type

func (*Error) WithValue added in v0.18.11

func (e *Error) WithValue(name string, value JSON) *Error

type ErrorValue added in v0.17.0

type ErrorValue struct {
	Name  string `field:"true" doc:"The name of the value."`
	Value JSON   `field:"true" doc:"The value."`
}

func (*ErrorValue) Type added in v0.17.0

func (e *ErrorValue) Type() *ast.Type

type ExecError added in v0.6.0

type ExecError struct {
	Err      error
	Cmd      []string
	ExitCode int
	Stdout   string
	Stderr   string
}

ExecError is a user-facing exec failure payload.

It supports GraphQL extension serialization via Extensions().

func (*ExecError) Error added in v0.6.0

func (e *ExecError) Error() string

func (*ExecError) Extensions added in v0.6.0

func (e *ExecError) Extensions() map[string]any

func (*ExecError) Unwrap added in v0.6.0

func (e *ExecError) Unwrap() error

type ExecTerminalArgs added in v0.18.17

type ExecTerminalArgs struct {
	Cmd []string `default:"[]"`
}

type ExistsFS added in v0.20.4

type ExistsFS interface {
	Exists(ctx context.Context, path string) (string, bool, error)
}

type ExistsType added in v0.18.15

type ExistsType string

func (ExistsType) Decoder added in v0.18.15

func (et ExistsType) Decoder() dagql.InputDecoder

func (ExistsType) MarshalJSON added in v0.18.15

func (et ExistsType) MarshalJSON() ([]byte, error)

func (ExistsType) ToLiteral added in v0.18.15

func (et ExistsType) ToLiteral() call.Literal

func (ExistsType) Type added in v0.18.15

func (et ExistsType) Type() *ast.Type

func (ExistsType) TypeDescription added in v0.18.15

func (et ExistsType) TypeDescription() string

func (*ExistsType) UnmarshalJSON added in v0.18.15

func (et *ExistsType) UnmarshalJSON(payload []byte) error

type ExportOpts added in v0.18.13

type ExportOpts struct {
	Dest              string
	PlatformVariants  []*Container
	ForcedCompression ImageLayerCompression
	MediaTypes        ImageMediaTypes
	Tar               bool
	LeaseID           string
}

type FetchHTTPRequestOpts added in v0.21.0

type FetchHTTPRequestOpts struct {
	URL                 string
	Filename            string
	Permissions         int
	Checksum            dagql.Optional[dagql.String]
	AuthorizationHeader string
}

type FieldTypeDef added in v0.8.8

type FieldTypeDef struct {
	Name        string `field:"true" doc:"The name of the field in lowerCamelCase format." doNotCache:"simple field selection"`
	Description string `field:"true" doc:"A doc string for the field, if any." doNotCache:"simple field selection"`
	TypeDef     dagql.ObjectResult[*TypeDef]

	SourceMap dagql.Nullable[dagql.ObjectResult[*SourceMap]] `field:"true" doc:"The location of this field declaration."`

	Deprecated *string `field:"true" doc:"The reason this enum member is deprecated, if any."`

	// The original name of the object as provided by the SDK that defined it, used
	// when invoking the SDK so it doesn't need to think as hard about case conversions
	OriginalName string
}

func NewFieldTypeDef added in v0.21.0

func NewFieldTypeDef(name string, typeDef dagql.ObjectResult[*TypeDef], description string, deprecated *string) *FieldTypeDef

func (*FieldTypeDef) AttachDependencyResults added in v0.21.0

func (field *FieldTypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (FieldTypeDef) Clone added in v0.8.8

func (field FieldTypeDef) Clone() *FieldTypeDef

func (*FieldTypeDef) DecodePersistedObject added in v0.21.0

func (*FieldTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*FieldTypeDef) EncodePersistedObject added in v0.21.0

func (field *FieldTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*FieldTypeDef) Type added in v0.9.7

func (*FieldTypeDef) Type() *ast.Type

func (*FieldTypeDef) TypeDescription added in v0.9.7

func (*FieldTypeDef) TypeDescription() string

func (*FieldTypeDef) WithSourceMap added in v0.21.0

func (field *FieldTypeDef) WithSourceMap(sourceMap dagql.ObjectResult[*SourceMap]) *FieldTypeDef

func (*FieldTypeDef) WithTypeDef added in v0.21.0

func (field *FieldTypeDef) WithTypeDef(typeDef dagql.ObjectResult[*TypeDef]) *FieldTypeDef

type FieldTypeDefID added in v0.21.0

type FieldTypeDefID = dagql.ID[*FieldTypeDef]

type File

type File struct {
	Platform Platform

	// Services necessary to provision the file.
	Services ServiceBindings

	Lazy     Lazy[*File]
	File     *LazyAccessor[string, *File]
	Snapshot *LazyAccessor[bkcache.ImmutableRef, *File]
}

File is a content-addressed file.

func (*File) AsEnvFile added in v0.18.18

func (file *File) AsEnvFile(ctx context.Context, self dagql.ObjectResult[*File], expand bool) (*EnvFile, error)

AsEnvFile converts a File to an EnvFile by parsing its contents

func (*File) AsJSON added in v0.19.8

func (file *File) AsJSON(ctx context.Context, self dagql.ObjectResult[*File]) (JSON, error)

AsJSON returns the file contents as JSON when possible, otherwise returns an error

func (*File) AttachDependencyResults added in v0.21.0

func (file *File) AttachDependencyResults(
	ctx context.Context,
	self dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*File) AttachDependencyResultsKinds added in v0.21.0

func (file *File) AttachDependencyResultsKinds(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.DependencyResult, error)

func (*File) CacheUsageIdentities added in v0.21.0

func (file *File) CacheUsageIdentities() []string

func (*File) CacheUsageSize added in v0.21.0

func (file *File) CacheUsageSize(ctx context.Context, identity string) (int64, bool, error)

func (*File) Chown added in v0.18.18

func (file *File) Chown(ctx context.Context, parent dagql.ObjectResult[*File], owner string) error

func (*File) Contents

func (file *File) Contents(ctx context.Context, self dagql.ObjectResult[*File], offset, limit *int) ([]byte, error)

Contents handles file content retrieval

func (*File) DecodePersistedObject added in v0.21.0

func (*File) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*File) Digest added in v0.5.2

func (file *File) Digest(ctx context.Context, self dagql.ObjectResult[*File], excludeMetadata bool) (string, error)

func (*File) EncodePersistedObject added in v0.21.0

func (file *File) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*File) LazyEvalFunc added in v0.21.0

func (file *File) LazyEvalFunc() dagql.LazyEvalFunc

func (*File) Mount added in v0.18.13

func (file *File) Mount(ctx context.Context, self dagql.ObjectResult[*File], f func(string) error) error

func (*File) OnRelease added in v0.16.3

func (file *File) OnRelease(ctx context.Context) error

func (*File) Open added in v0.5.0

func (file *File) Open(ctx context.Context, self dagql.ObjectResult[*File]) (io.ReadCloser, error)
func (file *File) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*File) Search added in v0.18.17

func (file *File) Search(ctx context.Context, self dagql.ObjectResult[*File], opts SearchOpts, verbose bool) ([]*SearchResult, error)

func (*File) Stat

func (file *File) Stat(ctx context.Context, self dagql.ObjectResult[*File]) (*Stat, error)

func (*File) Type added in v0.9.7

func (*File) Type() *ast.Type

func (*File) TypeDescription added in v0.9.7

func (*File) TypeDescription() string

func (*File) WithContents added in v0.21.0

func (file *File) WithContents(ctx context.Context, parent dagql.ObjectResult[*Directory], filePath string, content []byte, permissions fs.FileMode, ownership *Ownership) error

func (*File) WithName added in v0.11.6

func (file *File) WithName(ctx context.Context, parent dagql.ObjectResult[*File], filename string) error

func (*File) WithReplaced added in v0.18.17

func (file *File) WithReplaced(ctx context.Context, parent dagql.ObjectResult[*File], searchStr, replacementStr string, firstFrom *int, all bool) error

func (*File) WithTimestamps added in v0.3.8

func (file *File) WithTimestamps(ctx context.Context, parent dagql.ObjectResult[*File], unix int) error

type FileChownLazy added in v0.21.0

type FileChownLazy struct {
	LazyState
	Parent dagql.ObjectResult[*File]
	Owner  string
}

func (*FileChownLazy) AttachDependencies added in v0.21.0

func (lazy *FileChownLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*FileChownLazy) EncodePersisted added in v0.21.0

func (lazy *FileChownLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*FileChownLazy) Evaluate added in v0.21.0

func (lazy *FileChownLazy) Evaluate(ctx context.Context, file *File) error

type FileID

type FileID = dagql.ID[*File]

type FileSubfileLazy added in v0.21.0

type FileSubfileLazy struct {
	LazyState
	Parent dagql.ObjectResult[*Directory]
	Path   string
}

func (*FileSubfileLazy) AttachDependencies added in v0.21.0

func (lazy *FileSubfileLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*FileSubfileLazy) EncodePersisted added in v0.21.0

func (lazy *FileSubfileLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*FileSubfileLazy) Evaluate added in v0.21.0

func (lazy *FileSubfileLazy) Evaluate(ctx context.Context, file *File) error

type FileType added in v0.19.9

type FileType string

func FileModeToFileType added in v0.19.10

func FileModeToFileType(m fs.FileMode) FileType

func (FileType) Decoder added in v0.19.9

func (ft FileType) Decoder() dagql.InputDecoder

func (FileType) MarshalJSON added in v0.19.9

func (ft FileType) MarshalJSON() ([]byte, error)

func (FileType) ToLiteral added in v0.19.9

func (ft FileType) ToLiteral() call.Literal

func (FileType) Type added in v0.19.9

func (ft FileType) Type() *ast.Type

func (FileType) TypeDescription added in v0.19.9

func (ft FileType) TypeDescription() string

func (*FileType) UnmarshalJSON added in v0.19.9

func (ft *FileType) UnmarshalJSON(payload []byte) error

type FileWithNameLazy added in v0.21.0

type FileWithNameLazy struct {
	LazyState
	Parent   dagql.ObjectResult[*File]
	Filename string
}

func (*FileWithNameLazy) AttachDependencies added in v0.21.0

func (lazy *FileWithNameLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*FileWithNameLazy) EncodePersisted added in v0.21.0

func (lazy *FileWithNameLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*FileWithNameLazy) Evaluate added in v0.21.0

func (lazy *FileWithNameLazy) Evaluate(ctx context.Context, file *File) error

type FileWithReplacedLazy added in v0.21.0

type FileWithReplacedLazy struct {
	LazyState
	Parent      dagql.ObjectResult[*File]
	Search      string
	Replacement string
	FirstFrom   *int
	All         bool
}

func (*FileWithReplacedLazy) AttachDependencies added in v0.21.0

func (lazy *FileWithReplacedLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*FileWithReplacedLazy) EncodePersisted added in v0.21.0

func (lazy *FileWithReplacedLazy) EncodePersisted(ctx context.Context, cache dagql.PersistedObjectCache) (json.RawMessage, error)

func (*FileWithReplacedLazy) Evaluate added in v0.21.0

func (lazy *FileWithReplacedLazy) Evaluate(ctx context.Context, file *File) error

type FileWithTimestampsLazy added in v0.21.0

type FileWithTimestampsLazy struct {
	LazyState
	Parent    dagql.ObjectResult[*File]
	Timestamp int
}

func (*FileWithTimestampsLazy) AttachDependencies added in v0.21.0

func (lazy *FileWithTimestampsLazy) AttachDependencies(ctx context.Context, attach func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)

func (*FileWithTimestampsLazy) EncodePersisted added in v0.21.0

func (*FileWithTimestampsLazy) Evaluate added in v0.21.0

func (lazy *FileWithTimestampsLazy) Evaluate(ctx context.Context, file *File) error

type FuncCall added in v0.17.0

type FuncCall struct {
	Name      string         `json:"name"`
	Arguments map[string]any `json:"arguments"`
}

type Function added in v0.8.8

type Function struct {
	// Name is the standardized name of the function (lowerCamelCase), as used for the resolver in the graphql schema
	Name        string `field:"true" doc:"The name of the function." doNotCache:"simple field selection"`
	Description string `field:"true" doc:"A doc string for the function, if any." doNotCache:"simple field selection"`
	Args        dagql.ObjectResultArray[*FunctionArg]
	ReturnType  dagql.ObjectResult[*TypeDef]
	Deprecated  *string `field:"true" doc:"The reason this function is deprecated, if any."`

	SourceMap dagql.Nullable[dagql.ObjectResult[*SourceMap]] `field:"true" doc:"The location of this function declaration."`

	// SourceModuleName is set when the function is provided by a module (e.g. a module
	// constructor or auto-alias on the Query root). Empty for core API functions.
	SourceModuleName string `field:"true" doc:"If this function is provided by a module, the name of the module. Unset otherwise."`

	// Below are not in public API
	CachePolicy     FunctionCachePolicy
	CacheTTLSeconds dagql.Nullable[dagql.Int]

	// IsCheck indicates whether this function is a check
	IsCheck bool

	// IsGenerator indicates whether this function is a generator
	IsGenerator bool

	// IsUp indicates whether this function returns a service to be started with `dagger up`
	IsUp bool

	// OriginalName of the parent object
	ParentOriginalName string

	// The original name of the function as provided by the SDK that defined it, used
	// when invoking the SDK so it doesn't need to think as hard about case conversions
	OriginalName string
}

func NewFunction added in v0.8.8

func NewFunction(name string, returnType dagql.ObjectResult[*TypeDef]) *Function

func (*Function) AttachDependencyResults added in v0.21.0

func (fn *Function) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (Function) Clone added in v0.8.8

func (fn Function) Clone() *Function

func (*Function) DecodePersistedObject added in v0.21.0

func (*Function) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*Function) Directives added in v0.19.7

func (fn *Function) Directives() []*ast.Directive

Directives returns the GraphQL directives that should be applied to this function.

func (*Function) EncodePersistedObject added in v0.21.0

func (fn *Function) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Function) FieldSpec added in v0.9.7

func (fn *Function) FieldSpec(ctx context.Context, mod Mod) (dagql.FieldSpec, error)

FieldSpec converts a Function into a GraphQL field specification for inclusion in a GraphQL schema. This method is called during schema generation when building the GraphQL API representation of module functions. It transforms the Function's metadata (name, description, arguments, return type) into the dagql.FieldSpec format that the GraphQL engine can understand and expose as queryable fields.

The conversion process includes: - Converting function arguments to GraphQL input specifications with proper typing - Handling default values for arguments by JSON decoding and type validation - Adding source map directives for debugging/IDE support - Resolving module types through the provided Module context

This is typically called during module loading/registration when the Dagger engine builds the complete GraphQL schema that clients will query against.

func (*Function) IsSubtypeOf added in v0.9.6

func (fn *Function) IsSubtypeOf(otherFn *Function) bool

func (*Function) LookupArg added in v0.9.7

func (fn *Function) LookupArg(nameAnyCase string) (dagql.ObjectResult[*FunctionArg], bool)

func (*Function) Type added in v0.9.7

func (*Function) Type() *ast.Type

func (*Function) TypeDescription added in v0.9.7

func (*Function) TypeDescription() string

func (*Function) WithArg added in v0.8.8

func (fn *Function) WithArg(arg dagql.ObjectResult[*FunctionArg]) *Function

func (*Function) WithCheck added in v0.19.7

func (fn *Function) WithCheck() *Function

func (*Function) WithDeprecated added in v0.19.5

func (fn *Function) WithDeprecated(reason *string) *Function

func (*Function) WithDescription added in v0.8.8

func (fn *Function) WithDescription(desc string) *Function

func (*Function) WithGenerator added in v0.19.11

func (fn *Function) WithGenerator() *Function

func (*Function) WithReturnType added in v0.21.0

func (fn *Function) WithReturnType(returnType dagql.ObjectResult[*TypeDef]) *Function

func (*Function) WithSourceMap added in v0.13.7

func (fn *Function) WithSourceMap(sourceMap dagql.ObjectResult[*SourceMap]) *Function

func (*Function) WithUp added in v0.20.4

func (fn *Function) WithUp() *Function

type FunctionArg added in v0.8.8

type FunctionArg struct {
	// Name is the standardized name of the argument (lowerCamelCase), as used for the resolver in the graphql schema
	Name           string                                         `field:"true" doc:"The name of the argument in lowerCamelCase format." doNotCache:"simple field selection"`
	Description    string                                         `field:"true" doc:"A doc string for the argument, if any." doNotCache:"simple field selection"`
	SourceMap      dagql.Nullable[dagql.ObjectResult[*SourceMap]] `field:"true" doc:"The location of this arg declaration."`
	TypeDef        dagql.ObjectResult[*TypeDef]
	DefaultValue   JSON     `` /* 142-byte string literal not displayed */
	DefaultPath    string   `` /* 188-byte string literal not displayed */
	DefaultAddress string   `` /* 179-byte string literal not displayed */
	Ignore         []string `` /* 223-byte string literal not displayed */
	Deprecated     *string  `field:"true" doc:"The reason this function is deprecated, if any."`

	// The original name of the argument as provided by the SDK that defined it.
	OriginalName string
}

func NewFunctionArg added in v0.21.0

func NewFunctionArg(name string, typeDef dagql.ObjectResult[*TypeDef], desc string, defaultValue JSON, defaultPath string, defaultAddress string, ignore []string, deprecated *string) *FunctionArg

func (*FunctionArg) AttachDependencyResults added in v0.21.0

func (arg *FunctionArg) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (FunctionArg) Clone added in v0.8.8

func (arg FunctionArg) Clone() *FunctionArg

func (*FunctionArg) DecodePersistedObject added in v0.21.0

func (*FunctionArg) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (FunctionArg) Directives added in v0.19.0

func (arg FunctionArg) Directives() []*ast.Directive

func (*FunctionArg) EncodePersistedObject added in v0.21.0

func (arg *FunctionArg) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*FunctionArg) IsWorkspace added in v0.20.0

func (arg *FunctionArg) IsWorkspace() bool

IsWorkspace returns true if the argument is of type Workspace. Workspace arguments are always optional and automatically injected when not set.

func (*FunctionArg) Type added in v0.9.7

func (*FunctionArg) Type() *ast.Type

Type returns the GraphQL FunctionArg! type.

func (*FunctionArg) TypeDescription added in v0.9.7

func (*FunctionArg) TypeDescription() string

func (*FunctionArg) WithDefaultAddress added in v0.21.0

func (arg *FunctionArg) WithDefaultAddress(defaultAddress string) *FunctionArg

func (*FunctionArg) WithDefaultPath added in v0.21.0

func (arg *FunctionArg) WithDefaultPath(defaultPath string) *FunctionArg

func (*FunctionArg) WithDefaultValue added in v0.21.0

func (arg *FunctionArg) WithDefaultValue(defaultValue JSON) *FunctionArg

func (*FunctionArg) WithIgnore added in v0.21.0

func (arg *FunctionArg) WithIgnore(ignore []string) *FunctionArg

func (*FunctionArg) WithSourceMap added in v0.21.0

func (arg *FunctionArg) WithSourceMap(sourceMap dagql.ObjectResult[*SourceMap]) *FunctionArg

func (*FunctionArg) WithTypeDef added in v0.21.0

func (arg *FunctionArg) WithTypeDef(typeDef dagql.ObjectResult[*TypeDef]) *FunctionArg

type FunctionArgID added in v0.9.4

type FunctionArgID = dagql.ID[*FunctionArg]

type FunctionCachePolicy added in v0.19.4

type FunctionCachePolicy string

func (FunctionCachePolicy) Decoder added in v0.19.4

func (proto FunctionCachePolicy) Decoder() dagql.InputDecoder

func (FunctionCachePolicy) ToLiteral added in v0.19.4

func (proto FunctionCachePolicy) ToLiteral() call.Literal

func (FunctionCachePolicy) Type added in v0.19.4

func (proto FunctionCachePolicy) Type() *ast.Type

func (FunctionCachePolicy) TypeDescription added in v0.19.4

func (proto FunctionCachePolicy) TypeDescription() string

type FunctionCall added in v0.8.8

type FunctionCall struct {
	Name       string                  `field:"true" doc:"The name of the function being called."`
	ParentName string                  `` /* 154-byte string literal not displayed */
	Parent     JSON                    `` /* 155-byte string literal not displayed */
	InputArgs  []*FunctionCallArgValue `field:"true" doc:"The argument values the function is being invoked with."`
}

func (*FunctionCall) DecodePersistedObject added in v0.21.0

func (*FunctionCall) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*FunctionCall) EncodePersistedObject added in v0.21.0

func (fnCall *FunctionCall) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*FunctionCall) ReturnError added in v0.15.0

func (fnCall *FunctionCall) ReturnError(ctx context.Context, errID dagql.ID[*Error]) error

func (*FunctionCall) ReturnValue added in v0.9.7

func (fnCall *FunctionCall) ReturnValue(ctx context.Context, val JSON) error

func (*FunctionCall) Type added in v0.9.7

func (*FunctionCall) Type() *ast.Type

func (*FunctionCall) TypeDescription added in v0.9.7

func (*FunctionCall) TypeDescription() string

type FunctionCallArgValue added in v0.9.7

type FunctionCallArgValue struct {
	Name  string `field:"true" doc:"The name of the argument."`
	Value JSON   `field:"true" doc:"The value of the argument represented as a JSON serialized string."`
}

func (*FunctionCallArgValue) DecodePersistedObject added in v0.21.0

func (*FunctionCallArgValue) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*FunctionCallArgValue) EncodePersistedObject added in v0.21.0

func (*FunctionCallArgValue) Type added in v0.9.7

func (*FunctionCallArgValue) Type() *ast.Type

func (*FunctionCallArgValue) TypeDescription added in v0.9.7

func (*FunctionCallArgValue) TypeDescription() string

type FunctionID added in v0.8.8

type FunctionID = dagql.ID[*Function]

type GenaiClient added in v0.17.0

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

func (*GenaiClient) IsRetryable added in v0.18.4

func (c *GenaiClient) IsRetryable(err error) bool

func (*GenaiClient) SendQuery added in v0.17.0

func (c *GenaiClient) SendQuery(ctx context.Context, history []*ModelMessage, tools []LLMTool) (_ *LLMResponse, rerr error)

type GeneratedCode added in v0.8.8

type GeneratedCode struct {
	Code dagql.ObjectResult[*Directory] `field:"true" doc:"The directory containing the generated code."`

	VCSGeneratedPaths []string `field:"true" name:"vcsGeneratedPaths" doc:"List of paths to mark generated in version control (i.e. .gitattributes)."`
	VCSIgnoredPaths   []string `field:"true" name:"vcsIgnoredPaths" doc:"List of paths to ignore in version control (i.e. .gitignore)."`
}

func NewGeneratedCode added in v0.9.0

func NewGeneratedCode(code dagql.ObjectResult[*Directory]) *GeneratedCode

func (*GeneratedCode) AttachDependencyResults added in v0.21.0

func (code *GeneratedCode) AttachDependencyResults(
	ctx context.Context,
	self dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

AttachDependencyResults exposes the embedded Code directory as an owned dependency. This wires GeneratedCode -> Code into the cache liveness graph and lets failures in Code's lazy work (e.g. uv lock during Python codegen) be attributed back to the API span that returned this GeneratedCode.

func (GeneratedCode) Clone added in v0.8.8

func (code GeneratedCode) Clone() *GeneratedCode

func (*GeneratedCode) Type added in v0.9.7

func (*GeneratedCode) Type() *ast.Type

func (*GeneratedCode) TypeDescription added in v0.9.7

func (*GeneratedCode) TypeDescription() string

func (*GeneratedCode) WithVCSGeneratedPaths added in v0.8.8

func (code *GeneratedCode) WithVCSGeneratedPaths(paths []string) *GeneratedCode

func (*GeneratedCode) WithVCSIgnoredPaths added in v0.8.8

func (code *GeneratedCode) WithVCSIgnoredPaths(paths []string) *GeneratedCode

type GeneratedCodeID added in v0.8.8

type GeneratedCodeID = dagql.ID[*GeneratedCode]

type Generator added in v0.19.11

type Generator struct {
	Node      *ModTreeNode `json:"node"`
	Completed bool         `field:"true" doc:"Whether the generator complete"`
	Changes   dagql.ObjectResult[*Changeset]
}

Generator represents a generator function

func (*Generator) AttachDependencyResults added in v0.21.0

func (g *Generator) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*Generator) Clone added in v0.19.11

func (g *Generator) Clone() *Generator

func (*Generator) DecodePersistedObject added in v0.21.0

func (*Generator) DecodePersistedObject(
	ctx context.Context,
	dag *dagql.Server,
	_ uint64,
	_ *dagql.ResultCall,
	payload json.RawMessage,
) (dagql.Typed, error)

func (*Generator) Description added in v0.19.11

func (g *Generator) Description() string

func (*Generator) EncodePersistedObject added in v0.21.0

func (g *Generator) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Generator) Name added in v0.19.11

func (g *Generator) Name() string

func (*Generator) OriginalModule added in v0.20.0

func (g *Generator) OriginalModule() *Module

func (*Generator) Path added in v0.19.11

func (g *Generator) Path() []string

func (*Generator) RequireChanges added in v0.20.6

func (g *Generator) RequireChanges(field string) (*Changeset, error)

func (*Generator) RequireChangesResult added in v0.21.0

func (g *Generator) RequireChangesResult(field string) (dagql.ObjectResult[*Changeset], error)

func (*Generator) Run added in v0.19.11

func (g *Generator) Run(ctx context.Context) (*Generator, error)

func (*Generator) Type added in v0.19.11

func (*Generator) Type() *ast.Type

type GeneratorGroup added in v0.19.11

type GeneratorGroup struct {
	Node       *ModTreeNode `json:"node"`
	Generators []*Generator `json:"generators"`
}

func NewGeneratorGroup added in v0.19.11

func NewGeneratorGroup(ctx context.Context, mod dagql.ObjectResult[*Module], include []string) (*GeneratorGroup, error)

func (*GeneratorGroup) AttachDependencyResults added in v0.21.0

func (gg *GeneratorGroup) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*GeneratorGroup) Changes added in v0.19.11

func (gg *GeneratorGroup) Changes(ctx context.Context, conflictStrategy WithChangesetsMergeConflict) (*Changeset, error)

func (*GeneratorGroup) Clone added in v0.19.11

func (gg *GeneratorGroup) Clone() *GeneratorGroup

func (*GeneratorGroup) DecodePersistedObject added in v0.21.0

func (*GeneratorGroup) DecodePersistedObject(
	ctx context.Context,
	dag *dagql.Server,
	_ uint64,
	_ *dagql.ResultCall,
	payload json.RawMessage,
) (dagql.Typed, error)

func (*GeneratorGroup) EncodePersistedObject added in v0.21.0

func (*GeneratorGroup) IsEmpty added in v0.19.11

func (gg *GeneratorGroup) IsEmpty(ctx context.Context) (bool, error)

func (*GeneratorGroup) List added in v0.19.11

func (gg *GeneratorGroup) List(ctx context.Context) []*Generator

func (*GeneratorGroup) Run added in v0.19.11

Run all the generators in the group

func (*GeneratorGroup) Type added in v0.19.11

func (*GeneratorGroup) Type() *ast.Type

type GitModuleSource added in v0.9.8

type GitModuleSource struct {
	// The ref to clone the root of the git repo from
	CloneRef string

	// Symbolic is the CloneRef plus the SourceRootSubpath (no version)
	Symbolic string

	// The URL to the source's git repo in a web browser, at the root of the repo
	HTMLRepoURL string

	// The URL to the source's git repo in a web browser, including to the source root subpath
	HTMLURL string

	// The import path corresponding to the root of the git repo this source points to
	RepoRootPath string

	// The version of the source; may be a branch, tag, or commit hash
	Version string

	// The resolved commit hash of the source
	Commit string
	// The fully resolved git ref string of the source
	Ref string

	// The full git repo for the module source without any include filtering
	UnfilteredContextDir dagql.ObjectResult[*Directory]
}

func (GitModuleSource) Clone added in v0.9.8

func (src GitModuleSource) Clone() *GitModuleSource
func (src GitModuleSource) Link(filepath string, line int, column int) (string, error)

type GitRef added in v0.9.1

type GitRef struct {
	Repo    dagql.ObjectResult[*GitRepository]
	Backend GitRefBackend
	Ref     *gitutil.Ref
}

func MergeBase added in v0.18.15

func MergeBase(ctx context.Context, ref1 *GitRef, ref2 *GitRef) (*GitRef, error)

func (*GitRef) AttachDependencyResults added in v0.21.0

func (ref *GitRef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*GitRef) DecodePersistedObject added in v0.21.0

func (*GitRef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*GitRef) EncodePersistedObject added in v0.21.0

func (ref *GitRef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*GitRef) Tree added in v0.9.1

func (ref *GitRef) Tree(ctx context.Context, srv *dagql.Server, discardGitDir bool, depth int, includeTags bool) (*Directory, error)

func (*GitRef) Type added in v0.9.7

func (*GitRef) Type() *ast.Type

func (*GitRef) TypeDescription added in v0.9.7

func (*GitRef) TypeDescription() string

type GitRefBackend added in v0.16.3

type GitRefBackend interface {
	Tree(ctx context.Context, srv *dagql.Server, discard bool, depth int, includeTags bool) (checkout *Directory, err error)
	// contains filtered or unexported methods
}

type GitRefID added in v0.9.4

type GitRefID = dagql.ID[*GitRef]

type GitRepository added in v0.9.4

type GitRepository struct {
	URL     dagql.Nullable[dagql.String] `field:"true" doc:"The URL of the git repository."`
	Backend GitRepositoryBackend
	Remote  *gitutil.Remote

	DiscardGitDir bool
}

func NewGitRepository added in v0.19.0

func NewGitRepository(ctx context.Context, backend GitRepositoryBackend) (*GitRepository, error)

func (*GitRepository) AttachDependencyResults added in v0.21.0

func (repo *GitRepository) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*GitRepository) DecodePersistedObject added in v0.21.0

func (*GitRepository) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*GitRepository) EncodePersistedObject added in v0.21.0

func (repo *GitRepository) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*GitRepository) OnRelease added in v0.21.0

func (repo *GitRepository) OnRelease(ctx context.Context) error
func (repo *GitRepository) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*GitRepository) Type added in v0.9.7

func (*GitRepository) Type() *ast.Type

func (*GitRepository) TypeDescription added in v0.9.7

func (*GitRepository) TypeDescription() string

type GitRepositoryBackend added in v0.16.3

type GitRepositoryBackend interface {
	// Remote returns information about the git remote.
	Remote(ctx context.Context) (*gitutil.Remote, error)
	// Get returns a reference to a specific git ref (branch, tag, or commit).
	Get(ctx context.Context, ref *gitutil.Ref) (GitRefBackend, error)

	// Dirty returns a Directory representing the repository in it's current state.
	Dirty(ctx context.Context) (dagql.ObjectResult[*Directory], error)
	// Cleaned returns a Directory representing the repository with all uncommitted changes discarded.
	Cleaned(ctx context.Context) (dagql.ObjectResult[*Directory], error)
	// contains filtered or unexported methods
}

type GitRepositoryID added in v0.9.4

type GitRepositoryID = dagql.ID[*GitRepository]

type HTTPFetchResult added in v0.21.0

type HTTPFetchResult struct {
	File          *File
	ContentDigest digest.Digest
	LastModified  string
}

func FetchHTTPFile added in v0.21.0

func FetchHTTPFile(
	ctx context.Context,
	query *Query,
	opts FetchHTTPRequestOpts,
) (_ *HTTPFetchResult, rerr error)

type HTTPState added in v0.21.0

type HTTPState struct {
	URL string

	ETag          string
	LastModified  string
	ContentDigest digest.Digest
	// contains filtered or unexported fields
}

func (*HTTPState) CacheUsageIdentities added in v0.21.0

func (state *HTTPState) CacheUsageIdentities() []string

func (*HTTPState) CacheUsageMayChange added in v0.21.0

func (state *HTTPState) CacheUsageMayChange() bool

func (*HTTPState) CacheUsageSize added in v0.21.0

func (state *HTTPState) CacheUsageSize(ctx context.Context, identity string) (int64, bool, error)

func (*HTTPState) DecodePersistedObject added in v0.21.0

func (*HTTPState) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*HTTPState) EncodePersistedObject added in v0.21.0

func (state *HTTPState) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*HTTPState) OnRelease added in v0.21.0

func (state *HTTPState) OnRelease(ctx context.Context) error
func (state *HTTPState) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*HTTPState) Resolve added in v0.21.0

func (state *HTTPState) Resolve(
	ctx context.Context,
	query *Query,
	checksum dagql.Optional[dagql.String],
	permissions int,
	name string,
) (_ *HTTPFetchResult, rerr error)

func (*HTTPState) Type added in v0.21.0

func (*HTTPState) Type() *ast.Type

func (*HTTPState) TypeDescription added in v0.21.0

func (*HTTPState) TypeDescription() string

type Host added in v0.3.3

type Host struct{}

func (*Host) Clone added in v0.19.3

func (h *Host) Clone() *Host

func (*Host) DecodePersistedObject added in v0.21.0

func (*Host) DecodePersistedObject(context.Context, *dagql.Server, uint64, *dagql.ResultCall, json.RawMessage) (dagql.Typed, error)

func (*Host) EncodePersistedObject added in v0.21.0

func (Host) FindUp added in v0.18.18

func (Host) FindUp(
	ctx context.Context,
	statFS StatFS,
	curDirPath string,
	soughtName string,
) (string, bool, error)

find-up a given soughtName in curDirPath and its parent directories, return the absolute path to the dir it was found in, if any

func (Host) FindUpAll added in v0.18.18

func (Host) FindUpAll(
	ctx context.Context,
	statFS StatFS,
	curDirPath string,
	soughtNames map[string]struct{},
) (map[string]string, error)

find-up a set of soughtNames in curDirPath and its parent directories return what was found (name -> absolute path of dir containing it)

func (Host) GetEnv added in v0.19.1

func (Host) GetEnv(ctx context.Context, name string) string

Lookup an environment variable in the host system from the current context

func (*Host) Type added in v0.9.7

func (*Host) Type() *ast.Type

func (*Host) TypeDescription added in v0.9.7

func (*Host) TypeDescription() string

type ImageLayerCompression added in v0.5.3

type ImageLayerCompression string

func (ImageLayerCompression) Decoder added in v0.9.7

func (proto ImageLayerCompression) Decoder() dagql.InputDecoder

func (ImageLayerCompression) ToLiteral added in v0.9.7

func (proto ImageLayerCompression) ToLiteral() call.Literal

func (ImageLayerCompression) Type added in v0.9.7

func (proto ImageLayerCompression) Type() *ast.Type

func (ImageLayerCompression) TypeDescription added in v0.9.7

func (proto ImageLayerCompression) TypeDescription() string

type ImageMediaTypes added in v0.6.4

type ImageMediaTypes string

func (ImageMediaTypes) Decoder added in v0.9.7

func (proto ImageMediaTypes) Decoder() dagql.InputDecoder

func (ImageMediaTypes) ToLiteral added in v0.9.7

func (proto ImageMediaTypes) ToLiteral() call.Literal

func (ImageMediaTypes) Type added in v0.9.7

func (proto ImageMediaTypes) Type() *ast.Type

func (ImageMediaTypes) TypeDescription added in v0.9.7

func (proto ImageMediaTypes) TypeDescription() string

type InputTypeDef added in v0.9.8

type InputTypeDef struct {
	Name   string `field:"true" doc:"The name of the input object." doNotCache:"simple field selection"`
	Fields dagql.ObjectResultArray[*FieldTypeDef]
}

func (*InputTypeDef) AttachDependencyResults added in v0.21.0

func (typeDef *InputTypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (InputTypeDef) Clone added in v0.9.8

func (typeDef InputTypeDef) Clone() *InputTypeDef

func (*InputTypeDef) DecodePersistedObject added in v0.21.0

func (*InputTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*InputTypeDef) EncodePersistedObject added in v0.21.0

func (typeDef *InputTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*InputTypeDef) ToInputObjectSpec added in v0.9.8

func (typeDef *InputTypeDef) ToInputObjectSpec() dagql.InputObjectSpec

func (*InputTypeDef) Type added in v0.9.8

func (*InputTypeDef) Type() *ast.Type

func (*InputTypeDef) TypeDescription added in v0.9.8

func (*InputTypeDef) TypeDescription() string

func (*InputTypeDef) WithField added in v0.21.0

func (typeDef *InputTypeDef) WithField(field dagql.ObjectResult[*FieldTypeDef]) *InputTypeDef

type InputTypeDefID added in v0.21.0

type InputTypeDefID = dagql.ID[*InputTypeDef]

type InstallOpts added in v0.20.4

type InstallOpts struct {
	// SkipConstructor omits the module's constructor from the Query
	// root. The module's types are still installed for schema
	// resolution. Used for transitive dependencies whose types may
	// be returned through interfaces.
	SkipConstructor bool

	// Entrypoint installs non-conflicting proxies for the module's
	// main-object methods on the Query root. The module's namespaced
	// constructor remains installed separately.
	Entrypoint bool
}

InstallOpts controls how a module is installed into a dagql server.

type InterfaceAnnotatedValue added in v0.9.7

type InterfaceAnnotatedValue struct {
	TypeDef        *InterfaceTypeDef
	IfaceType      *InterfaceType
	Fields         map[string]any
	UnderlyingType ModType
}

func (*InterfaceAnnotatedValue) AttachDependencyResults added in v0.21.0

func (iface *InterfaceAnnotatedValue) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*InterfaceAnnotatedValue) Type added in v0.9.7

func (iface *InterfaceAnnotatedValue) Type() *ast.Type

func (*InterfaceAnnotatedValue) TypeDefinition added in v0.13.7

func (iface *InterfaceAnnotatedValue) TypeDefinition(view call.View) *ast.Definition

func (*InterfaceAnnotatedValue) TypeDescription added in v0.9.7

func (iface *InterfaceAnnotatedValue) TypeDescription() string

func (*InterfaceAnnotatedValue) UnderlyingObject added in v0.18.13

func (iface *InterfaceAnnotatedValue) UnderlyingObject() (dagql.Typed, error)

type InterfaceType added in v0.9.7

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

func (*InterfaceType) CollectContent added in v0.20.0

func (iface *InterfaceType) CollectContent(ctx context.Context, value dagql.AnyResult, content *CollectedContent) error

func (*InterfaceType) ConvertFromSDKResult added in v0.9.7

func (iface *InterfaceType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error)

func (*InterfaceType) ConvertToSDKInput added in v0.9.7

func (iface *InterfaceType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)

func (*InterfaceType) Install added in v0.9.7

func (iface *InterfaceType) Install(ctx context.Context, dag *dagql.Server) error

func (*InterfaceType) SourceMod added in v0.9.7

func (iface *InterfaceType) SourceMod() Mod

func (*InterfaceType) TypeDef added in v0.9.7

func (iface *InterfaceType) TypeDef(ctx context.Context) (dagql.ObjectResult[*TypeDef], error)

type InterfaceTypeDef added in v0.9.6

type InterfaceTypeDef struct {
	// Name is the standardized name of the interface (CamelCase), as used for the interface in the graphql schema
	Name        string                                         `field:"true" doc:"The name of the interface." doNotCache:"simple field selection"`
	Description string                                         `field:"true" doc:"The doc string for the interface, if any." doNotCache:"simple field selection"`
	SourceMap   dagql.Nullable[dagql.ObjectResult[*SourceMap]] `field:"true" doc:"The location of this interface declaration."`
	Functions   dagql.ObjectResultArray[*Function]
	// SourceModuleName is currently only set when returning the TypeDef from the Objects field on Module
	SourceModuleName string `` /* 149-byte string literal not displayed */

	// The original name of the interface as provided by the SDK that defined it, used
	// when invoking the SDK so it doesn't need to think as hard about case conversions
	OriginalName string
}

func NewInterfaceTypeDef added in v0.9.6

func NewInterfaceTypeDef(name, description string) *InterfaceTypeDef

func (*InterfaceTypeDef) AttachDependencyResults added in v0.21.0

func (iface *InterfaceTypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (InterfaceTypeDef) Clone added in v0.9.6

func (iface InterfaceTypeDef) Clone() *InterfaceTypeDef

func (*InterfaceTypeDef) DecodePersistedObject added in v0.21.0

func (*InterfaceTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*InterfaceTypeDef) EncodePersistedObject added in v0.21.0

func (iface *InterfaceTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*InterfaceTypeDef) IsSubtypeOf added in v0.9.6

func (iface *InterfaceTypeDef) IsSubtypeOf(otherIface *InterfaceTypeDef) bool

func (*InterfaceTypeDef) Type added in v0.9.7

func (*InterfaceTypeDef) Type() *ast.Type

func (*InterfaceTypeDef) TypeDescription added in v0.9.7

func (*InterfaceTypeDef) TypeDescription() string

func (*InterfaceTypeDef) WithFunction added in v0.21.0

func (iface *InterfaceTypeDef) WithFunction(fn dagql.ObjectResult[*Function]) *InterfaceTypeDef

func (*InterfaceTypeDef) WithName added in v0.21.0

func (iface *InterfaceTypeDef) WithName(name string) *InterfaceTypeDef

func (*InterfaceTypeDef) WithSourceMap added in v0.13.7

func (iface *InterfaceTypeDef) WithSourceMap(sourceMap dagql.ObjectResult[*SourceMap]) *InterfaceTypeDef

func (*InterfaceTypeDef) WithSourceModuleName added in v0.21.0

func (iface *InterfaceTypeDef) WithSourceModuleName(sourceModuleName string) *InterfaceTypeDef

type InterfaceTypeDefID added in v0.21.0

type InterfaceTypeDefID = dagql.ID[*InterfaceTypeDef]

type JSON added in v0.9.7

type JSON json.RawMessage

func (JSON) Bytes added in v0.9.7

func (p JSON) Bytes() []byte

func (JSON) DecodeInput added in v0.9.7

func (JSON) DecodeInput(val any) (res dagql.Input, err error)

func (JSON) Decoder added in v0.9.7

func (p JSON) Decoder() dagql.InputDecoder

func (JSON) MarshalJSON added in v0.9.7

func (p JSON) MarshalJSON() ([]byte, error)

func (JSON) String added in v0.18.4

func (p JSON) String() string

func (JSON) ToLiteral added in v0.9.7

func (p JSON) ToLiteral() call.Literal

func (JSON) Type added in v0.9.7

func (p JSON) Type() *ast.Type

func (JSON) TypeDescription added in v0.9.7

func (p JSON) TypeDescription() string

func (JSON) TypeName added in v0.9.7

func (p JSON) TypeName() string

func (*JSON) UnmarshalJSON added in v0.11.8

func (p *JSON) UnmarshalJSON(bs []byte) error

func (JSON) Validate added in v0.19.8

func (p JSON) Validate() error

Validate checks if the JSON is valid

type JSONValue added in v0.18.17

type JSONValue struct {
	Data []byte
}

JSONValue is a simple state carrier for JSON-encoded bytes

func (*JSONValue) Type added in v0.18.17

func (*JSONValue) Type() *ast.Type

type JSONValueID added in v0.18.17

type JSONValueID = dagql.ID[*JSONValue]

type LLM added in v0.17.0

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

An instance of a LLM (large language model), with its state and tool calling environment

func (*LLM) BindResult added in v0.18.0

func (llm *LLM) BindResult(ctx context.Context, dag *dagql.Server, name string) (dagql.Nullable[*Binding], error)

func (*LLM) Clone added in v0.17.0

func (llm *LLM) Clone() *LLM

func (*LLM) Endpoint added in v0.17.0

func (llm *LLM) Endpoint(ctx context.Context) (*LLMEndpoint, error)

func (*LLM) Env added in v0.18.0

func (llm *LLM) Env() dagql.ObjectResult[*Env]

func (*LLM) HasPrompt added in v0.19.0

func (llm *LLM) HasPrompt() bool

func (*LLM) History added in v0.17.0

func (llm *LLM) History(ctx context.Context) ([]string, error)

func (*LLM) HistoryJSON added in v0.17.0

func (llm *LLM) HistoryJSON(ctx context.Context) (JSON, error)

func (*LLM) Interject added in v0.18.2

func (llm *LLM) Interject(ctx context.Context) error

func (*LLM) LastReply added in v0.17.0

func (llm *LLM) LastReply(ctx context.Context) (string, error)

Return the last message sent by the agent

func (*LLM) MCP added in v0.18.0

func (llm *LLM) MCP(ctx context.Context, dag *dagql.Server) error

func (*LLM) Step added in v0.19.0

func (llm *LLM) Step() *LLM

Send configures the LLM to only evaluate one step when syncing.

func (*LLM) Sync added in v0.17.0

func (llm *LLM) Sync(ctx context.Context) error

send the context to the LLM endpoint, process replies and tool calls; continue in a loop Synchronize LLM state: 1. Send context to LLM endpoint 2. Process replies and tool calls 3. Continue in a loop until no tool calls, or caps are reached

func (*LLM) TokenUsage added in v0.17.2

func (llm *LLM) TokenUsage(ctx context.Context, dag *dagql.Server) (*LLMTokenUsage, error)

func (*LLM) ToolsDoc added in v0.17.0

func (llm *LLM) ToolsDoc(ctx context.Context) (string, error)

Generate a human-readable documentation of tools available to the model

func (*LLM) Type added in v0.17.0

func (*LLM) Type() *ast.Type

func (*LLM) WithBlockedFunction added in v0.19.0

func (llm *LLM) WithBlockedFunction(ctx context.Context, typeName, funcName string) (*LLM, error)

Disable the default system prompt

func (*LLM) WithEnv added in v0.18.0

func (llm *LLM) WithEnv(env dagql.ObjectResult[*Env]) *LLM

func (*LLM) WithMCPServer added in v0.19.0

func (llm *LLM) WithMCPServer(name string, svc dagql.ObjectResult[*Service]) *LLM

Add an external MCP server to the LLM

func (*LLM) WithModel added in v0.17.0

func (llm *LLM) WithModel(model string) *LLM

func (*LLM) WithPrompt added in v0.17.0

func (llm *LLM) WithPrompt(

	prompt string,
) *LLM

Append a user message (prompt) to the message history

func (*LLM) WithPromptFile added in v0.17.0

func (llm *LLM) WithPromptFile(ctx context.Context, file *File) (*LLM, error)

WithPromptFile is like WithPrompt but reads the prompt from a file

func (*LLM) WithStaticTools added in v0.19.0

func (llm *LLM) WithStaticTools() *LLM

func (*LLM) WithSystemPrompt added in v0.17.0

func (llm *LLM) WithSystemPrompt(prompt string) *LLM

Append a system prompt message to the history

func (*LLM) WithoutDefaultSystemPrompt added in v0.18.4

func (llm *LLM) WithoutDefaultSystemPrompt() *LLM

Disable the default system prompt

func (*LLM) WithoutMessageHistory added in v0.19.6

func (llm *LLM) WithoutMessageHistory() *LLM

WithoutMessageHistory removes all messages, leaving only the system prompts

func (*LLM) WithoutSystemPrompts added in v0.19.6

func (llm *LLM) WithoutSystemPrompts() *LLM

WithoutSystemPrompts removes all system prompts from the history, leaving only the default system prompt

type LLMClient added in v0.17.0

type LLMClient interface {
	SendQuery(ctx context.Context, history []*ModelMessage, tools []LLMTool) (*LLMResponse, error)
	IsRetryable(err error) bool
}

LLMClient interface defines the methods that each provider must implement

type LLMEndpoint added in v0.17.0

type LLMEndpoint struct {
	Model    string
	BaseURL  string
	Key      string
	Provider LLMProvider
	Client   LLMClient
}

type LLMID added in v0.18.0

type LLMID = dagql.ID[*LLM]

type LLMProvider added in v0.17.0

type LLMProvider string
const (
	OpenAI    LLMProvider = "openai"
	Anthropic LLMProvider = "anthropic"
	Google    LLMProvider = "google"
	Meta      LLMProvider = "meta"
	Mistral   LLMProvider = "mistral"
	DeepSeek  LLMProvider = "deepseek"
	Other     LLMProvider = "other"
)

type LLMReplayer added in v0.17.0

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

func (*LLMReplayer) IsRetryable added in v0.18.4

func (*LLMReplayer) IsRetryable(err error) bool

func (*LLMReplayer) SendQuery added in v0.17.0

func (c *LLMReplayer) SendQuery(ctx context.Context, history []*ModelMessage, tools []LLMTool) (_ *LLMResponse, rerr error)

type LLMResponse added in v0.17.0

type LLMResponse struct {
	Content    string
	ToolCalls  []LLMToolCall
	TokenUsage LLMTokenUsage
}

type LLMRouter added in v0.17.0

type LLMRouter struct {
	AnthropicAPIKey  string
	AnthropicBaseURL string
	AnthropicModel   string

	OpenAIAPIKey           string
	OpenAIAzureVersion     string
	OpenAIBaseURL          string
	OpenAIModel            string
	OpenAIDisableStreaming bool

	GeminiAPIKey  string
	GeminiBaseURL string
	GeminiModel   string
}

A LLM routing configuration

func NewLLMRouter added in v0.17.0

func NewLLMRouter(ctx context.Context, srv *dagql.Server) (_ *LLMRouter, rerr error)

func (*LLMRouter) DefaultModel added in v0.17.0

func (r *LLMRouter) DefaultModel() string

Return a default model, if configured

func (*LLMRouter) LoadConfig added in v0.17.0

func (r *LLMRouter) LoadConfig(ctx context.Context, getenv func(context.Context, string) (string, error)) error

func (*LLMRouter) Route added in v0.17.0

func (r *LLMRouter) Route(model string) (*LLMEndpoint, error)

Return an endpoint for the requested model If the model name is not set, a default will be selected.

type LLMTokenUsage added in v0.17.2

type LLMTokenUsage struct {
	InputTokens       int64 `field:"true" json:"input_tokens"`
	OutputTokens      int64 `field:"true" json:"output_tokens"`
	CachedTokenReads  int64 `field:"true" json:"cached_token_reads"`
	CachedTokenWrites int64 `field:"true" json:"cached_token_writes"`
	TotalTokens       int64 `field:"true" json:"total_tokens"`
}

func (*LLMTokenUsage) Type added in v0.17.2

func (*LLMTokenUsage) Type() *ast.Type

type LLMTool added in v0.17.0

type LLMTool struct {
	// Tool name
	Name string `json:"name"`
	// MCP server name providing the tool, if any
	Server string
	// Tool description
	Description string `json:"description"`
	// Tool argument schema. Key is argument name. Value is unmarshalled json-schema for the argument.
	Schema map[string]any `json:"schema"`
	// Whether the tool schema is strict.
	// https://platform.openai.com/docs/guides/structured-outputs?api-mode=chat
	Strict bool `json:"-"`
	// Whether we should hide the LLM tool call span in favor of just showing its
	// child spans.
	HideSelf bool `json:"-"`
	// Whether the tool is read-only (from MCP ReadOnlyHint annotation)
	ReadOnly bool `json:"-"`
	// GraphQL API field that this tool corresponds to
	Field *ast.FieldDefinition `json:"-"`
	// Function implementing the tool.
	Call LLMToolFunc `json:"-"`
}

A frontend for LLM tool calling

type LLMToolCall added in v0.18.4

type LLMToolCall struct {
	ID       string   `json:"id"`
	Function FuncCall `json:"function"`
	Type     string   `json:"type"`
}

type LLMToolFunc added in v0.19.0

type LLMToolFunc = func(context.Context, any) (any, error)

type LLMToolSet added in v0.19.0

type LLMToolSet = dagui.OrderedSet[string, LLMTool]

func NewLLMToolSet added in v0.19.0

func NewLLMToolSet() *LLMToolSet

type LLMVariable added in v0.17.0

type LLMVariable struct {
	// The name of the variable
	Name string `field:"true"`
	// The type name of the variable's value
	TypeName string `field:"true"`
	// A hash of the variable's value, used to detect changes
	Hash string `field:"true"`
}

A variable in the LLM environment

func (*LLMVariable) Type added in v0.17.0

func (v *LLMVariable) Type() *ast.Type

type Lazy added in v0.21.0

type Lazy[T dagql.Typed] interface {
	Evaluate(context.Context, T) error
	AttachDependencies(context.Context, func(dagql.AnyResult) (dagql.AnyResult, error)) ([]dagql.AnyResult, error)
	EncodePersisted(context.Context, dagql.PersistedObjectCache) (json.RawMessage, error)
}

type LazyAccessor added in v0.21.0

type LazyAccessor[V any, T dagql.Typed] struct {
	// contains filtered or unexported fields
}

func CloneContainerDirectoryAccessor added in v0.21.0

func CloneContainerDirectoryAccessor(ctx context.Context, src *LazyAccessor[*Directory, *Container]) (*LazyAccessor[*Directory, *Container], error)

func CloneContainerFileAccessor added in v0.21.0

func CloneContainerFileAccessor(ctx context.Context, src *LazyAccessor[*File, *Container]) (*LazyAccessor[*File, *Container], error)

func CloneContainerMetaSnapshot added in v0.21.0

func (*LazyAccessor[V, T]) GetOrEval added in v0.21.0

func (a *LazyAccessor[V, T]) GetOrEval(ctx context.Context, res dagql.Result[T]) (V, error)

WARN: res MUST be the dagql result wrapper for the same owner object as this accessor. The accessor cannot validate that today due to the current Directory/File/Container vs dagql.Result split, so callers must pass the matching result explicitly and carefully.

func (*LazyAccessor[V, T]) Peek added in v0.21.0

func (a *LazyAccessor[V, T]) Peek() (V, bool)

Peek returns the current stored value without triggering lazy evaluation.

func (*LazyAccessor[V, T]) SetValue added in v0.21.0

func (a *LazyAccessor[V, T]) SetValue(v V)

SetValue is for constructors and lazy evaluation implementations that need to pre-seed or materialize an accessor explicitly.

type LazyState added in v0.21.0

type LazyState struct {
	LazyMu           *sync.Mutex
	LazyInitComplete bool
}

func NewLazyState added in v0.21.0

func NewLazyState() LazyState

func (*LazyState) Evaluate added in v0.21.0

func (lazy *LazyState) Evaluate(ctx context.Context, typeName string, run func(context.Context) error) (rerr error)

type ListType added in v0.9.7

type ListType struct {
	Elem       dagql.ObjectResult[*TypeDef]
	Underlying ModType
}

func (*ListType) CollectContent added in v0.20.0

func (t *ListType) CollectContent(ctx context.Context, value dagql.AnyResult, content *CollectedContent) error

func (*ListType) ConvertFromSDKResult added in v0.9.7

func (t *ListType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error)

func (*ListType) ConvertToSDKInput added in v0.9.7

func (t *ListType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)

func (*ListType) SourceMod added in v0.9.7

func (t *ListType) SourceMod() Mod

func (*ListType) TypeDef added in v0.9.7

func (t *ListType) TypeDef(ctx context.Context) (dagql.ObjectResult[*TypeDef], error)

type ListTypeDef added in v0.8.8

type ListTypeDef struct {
	ElementTypeDef dagql.ObjectResult[*TypeDef]
}

func (*ListTypeDef) AttachDependencyResults added in v0.21.0

func (typeDef *ListTypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (ListTypeDef) Clone added in v0.8.8

func (typeDef ListTypeDef) Clone() *ListTypeDef

func (*ListTypeDef) DecodePersistedObject added in v0.21.0

func (*ListTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*ListTypeDef) EncodePersistedObject added in v0.21.0

func (typeDef *ListTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*ListTypeDef) Type added in v0.9.7

func (*ListTypeDef) Type() *ast.Type

func (*ListTypeDef) TypeDescription added in v0.9.7

func (*ListTypeDef) TypeDescription() string

func (*ListTypeDef) WithElementTypeDef added in v0.21.0

func (typeDef *ListTypeDef) WithElementTypeDef(elementTypeDef dagql.ObjectResult[*TypeDef]) *ListTypeDef

type ListTypeDefID added in v0.21.0

type ListTypeDefID = dagql.ID[*ListTypeDef]

type LoadedImportedImage added in v0.21.0

type LoadedImportedImage struct {
	Image  bkcache.ImportedImage
	Config dockerspec.DockerOCIImage
}

type LocalGitRef added in v0.16.3

type LocalGitRef struct {
	*gitutil.Ref
	// contains filtered or unexported fields
}

func (*LocalGitRef) Tree added in v0.16.3

func (ref *LocalGitRef) Tree(ctx context.Context, srv *dagql.Server, discardGitDir bool, depth int, includeTags bool) (_ *Directory, rerr error)

type LocalGitRepository added in v0.16.3

type LocalGitRepository struct {
	Directory dagql.ObjectResult[*Directory]
}

func (*LocalGitRepository) Cleaned added in v0.19.4

func (repo *LocalGitRepository) Cleaned(ctx context.Context) (inst dagql.ObjectResult[*Directory], rerr error)

func (*LocalGitRepository) Dirty added in v0.19.4

func (repo *LocalGitRepository) Dirty(ctx context.Context) (inst dagql.ObjectResult[*Directory], rerr error)

func (*LocalGitRepository) File added in v0.19.0

func (repo *LocalGitRepository) File(ctx context.Context, filename string) (*File, error)

func (*LocalGitRepository) Get added in v0.19.0

func (*LocalGitRepository) Remote added in v0.19.0

func (repo *LocalGitRepository) Remote(ctx context.Context) (*gitutil.Remote, error)

type LocalModuleSource added in v0.9.8

type LocalModuleSource struct {
	ContextDirectoryPath string
}

func (LocalModuleSource) Clone added in v0.9.8

func (src LocalModuleSource) Clone() *LocalModuleSource

type MCP added in v0.18.0

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

Internal implementation of the MCP standard, for exposing a Dagger environment to a LLM via tool calling.

func (*MCP) BlockFunction added in v0.19.0

func (m *MCP) BlockFunction(ctx context.Context, typeName, funcName string) error

func (*MCP) Call added in v0.18.0

func (m *MCP) Call(ctx context.Context, tools []LLMTool, toolCall LLMToolCall) (res string, failed bool)

func (*MCP) CallBatch added in v0.19.0

func (m *MCP) CallBatch(ctx context.Context, tools []LLMTool, toolCalls []LLMToolCall) []*ModelMessage

CallBatch executes a batch of tool calls, handling MCP server syncing efficiently by grouping calls by destructiveness and server to avoid workspace conflicts

func (*MCP) Clone added in v0.18.0

func (m *MCP) Clone() *MCP

func (*MCP) DefaultSystemPrompt added in v0.18.0

func (m *MCP) DefaultSystemPrompt(ctx context.Context) (string, error)

func (*MCP) GetObject added in v0.18.0

func (m *MCP) GetObject(ctx context.Context, key, expectedType string) (dagql.AnyObjectResult, error)

Get an object saved at a given key

func (*MCP) Ingest added in v0.19.0

func (m *MCP) Ingest(ctx context.Context, obj dagql.AnyObjectResult, desc string) (string, error)

func (*MCP) IngestBy added in v0.19.0

func (m *MCP) IngestBy(obj dagql.AnyObjectResult, desc string, hash digest.Digest) (string, error)

func (*MCP) IngestContextual added in v0.19.0

func (m *MCP) IngestContextual(
	hash digest.Digest,
	desc string,
	typeName string,
	create func(ctx context.Context, env dagql.ObjectResult[*Env]) (dagql.AnyResult, error),
) string

func (*MCP) Input added in v0.19.0

func (m *MCP) Input(ctx context.Context, key string) (*Binding, bool, error)

Lookup an input binding

func (*MCP) IsDone added in v0.18.2

func (m *MCP) IsDone() bool

func (*MCP) LastResult added in v0.18.4

func (m *MCP) LastResult() dagql.Typed

func (*MCP) LookupTool added in v0.19.0

func (m *MCP) LookupTool(name string, tools []LLMTool) (*LLMTool, error)

LookupTool looks for a tool identified by a name.

func (*MCP) Returned added in v0.18.4

func (m *MCP) Returned() bool

func (*MCP) Server added in v0.19.0

func (m *MCP) Server(ctx context.Context) (*dagql.Server, error)

func (*MCP) Tools added in v0.18.0

func (m *MCP) Tools(ctx context.Context) ([]LLMTool, error)

func (*MCP) TypeCounts added in v0.19.0

func (m *MCP) TypeCounts() map[string]int

func (*MCP) Types added in v0.19.0

func (m *MCP) Types(ctx context.Context) ([]string, error)

func (*MCP) WithMCPServer added in v0.19.0

func (m *MCP) WithMCPServer(srv *MCPServerConfig) *MCP

type MCPServerConfig added in v0.19.0

type MCPServerConfig struct {
	// Name of the MCP server
	Name string

	// Command to run the MCP server
	Service dagql.ObjectResult[*Service]
}

MCPServerConfig represents configuration for an external MCP server

func (*MCPServerConfig) Dial added in v0.19.0

func (srv *MCPServerConfig) Dial(ctx context.Context) (_ *mcp.ClientSession, rerr error)

type Mod added in v0.9.7

type Mod interface {
	// Name gets the name of the module
	Name() string

	// Same reports whether this module is the same installed module instance as
	// the other module.
	Same(Mod) (bool, error)

	// View gets the name of the module's view of its underlying schema
	View() (call.View, bool)

	// Install modifies the provided server to install the contents of the
	// modules declared fields.
	Install(ctx context.Context, dag *dagql.Server, opts ...InstallOpts) error

	// ModTypeFor returns the ModType for the given typedef based on this module's schema.
	// The returned type will have any namespacing already applied.
	// If checkDirectDeps is true, then its direct dependencies will also be checked.
	ModTypeFor(ctx context.Context, typeDef *TypeDef, checkDirectDeps bool) (ModType, bool, error)

	// TypeDefs gets the TypeDefs exposed by this module (not including
	// dependencies) from the given unified schema. Implicitly, TypeDefs
	// returned by this module include any extensions installed by other
	// modules from the unified schema. (e.g. LLM which is extended with each
	// type via middleware)
	TypeDefs(ctx context.Context, dag *dagql.Server) (dagql.ObjectResultArray[*TypeDef], error)

	// Source returns the ModuleSource for this module
	GetSource() *ModuleSource

	// ResultCallModule returns the native module provenance attached to calls
	// provided by this module.
	ResultCallModule(context.Context) (*dagql.ResultCallModule, error)

	// ModuleResult returns the wrapped module result for user modules, or the
	// zero value for non-module implementations like core.
	ModuleResult() dagql.ObjectResult[*Module]
}

func NewUserMod added in v0.21.0

func NewUserMod(modInst dagql.ObjectResult[*Module]) Mod

type ModTreeNode added in v0.19.11

type ModTreeNode struct {
	Parent      *ModTreeNode
	Name        string
	Description string
	DagqlServer *dagql.Server
	// This module is the same across all ModTreeNode, this is the root module.
	Module dagql.ObjectResult[*Module]
	// This original module is the one in which the node has been defined.
	OriginalModule dagql.ObjectResult[*Module]
	Type           dagql.ObjectResult[*TypeDef]
	IsCheck        bool
	IsGenerator    bool
	IsUp           bool
}

func NewModTree added in v0.19.11

func NewModTree(ctx context.Context, mod dagql.ObjectResult[*Module]) (*ModTreeNode, error)

func (*ModTreeNode) Child added in v0.19.11

func (node *ModTreeNode) Child(ctx context.Context, name string) (*ModTreeNode, error)

func (*ModTreeNode) Children added in v0.19.11

func (node *ModTreeNode) Children(ctx context.Context) ([]*ModTreeNode, error)

Children returns child nodes for tree walking. NOTE: When a function returns a module-defined object, both a function leaf (preserving IsCheck/IsGenerator/IsUp) and an object subtree child are added with the same Name. This is intentional so that leaf flags are preserved while the object's nested functions are still discoverable via the subtree. Callers that need unique results should deduplicate by path (see RollupNodes).

func (*ModTreeNode) ChildrenNames added in v0.19.11

func (node *ModTreeNode) ChildrenNames(ctx context.Context) ([]string, error)

func (*ModTreeNode) Clone added in v0.19.11

func (node *ModTreeNode) Clone() *ModTreeNode

func (*ModTreeNode) DagqlValue added in v0.19.11

func (node *ModTreeNode) DagqlValue(ctx context.Context, dest any) error

func (*ModTreeNode) Match added in v0.19.11

func (node *ModTreeNode) Match(ctx context.Context, patterns []string) (bool, error)

func (*ModTreeNode) ObjectType added in v0.19.11

func (node *ModTreeNode) ObjectType() *ObjectTypeDef

func (*ModTreeNode) Path added in v0.19.11

func (node *ModTreeNode) Path() ModTreePath

func (*ModTreeNode) PathString added in v0.19.11

func (node *ModTreeNode) PathString() string

func (*ModTreeNode) RollupChecks added in v0.19.11

func (node *ModTreeNode) RollupChecks(ctx context.Context, include []string, exclude []string) ([]*ModTreeNode, error)

Walk the tree and return all check nodes, with include and exclude filters applied.

func (*ModTreeNode) RollupGenerator added in v0.19.11

func (node *ModTreeNode) RollupGenerator(ctx context.Context, include []string, exclude []string) ([]*ModTreeNode, error)

Walk the tree and return all generator nodes, with include and exclude filters applied.

func (*ModTreeNode) RollupNodes added in v0.19.11

func (node *ModTreeNode) RollupNodes(ctx context.Context, matches func(*ModTreeNode) bool, include []string, exclude []string) ([]*ModTreeNode, error)

Walk the tree and return all matching nodes, with include and exclude filters applied.

func (*ModTreeNode) RollupUp added in v0.20.4

func (node *ModTreeNode) RollupUp(ctx context.Context, include []string, exclude []string) ([]*ModTreeNode, error)

Walk the tree and return all up (service) nodes, with include and exclude filters applied.

func (*ModTreeNode) RootAddress added in v0.19.11

func (node *ModTreeNode) RootAddress() string

The address of the dagger module that is the root of the tree If the node is a "file", the root address is the URL of the filesystem root

func (*ModTreeNode) Run added in v0.19.11

func (node *ModTreeNode) Run(
	ctx context.Context,

	isLeaf func(*ModTreeNode) bool,

	runLeaf func(context.Context, *ModTreeNode, *engine.ClientMetadata) error,
	include, exclude []string,
) (rerr error)

func (*ModTreeNode) RunCheck added in v0.19.11

func (node *ModTreeNode) RunCheck(ctx context.Context, include, exclude []string) error

func (*ModTreeNode) RunGenerator added in v0.19.11

func (node *ModTreeNode) RunGenerator(ctx context.Context, include, exclude []string) (dagql.ObjectResult[*Changeset], error)

func (*ModTreeNode) RunGeneratorAsCheck added in v0.21.0

func (node *ModTreeNode) RunGeneratorAsCheck(ctx context.Context, include, exclude []string) error

func (*ModTreeNode) RunUp added in v0.20.4

func (node *ModTreeNode) RunUp(ctx context.Context, include, exclude []string, portMappings []PortForward) (*runUpStartResult, error)

RunUp starts the service and returns a result that must be cleaned up. It does NOT block — the caller (UpGroup.Run) handles the blocking wait.

func (*ModTreeNode) Walk added in v0.19.11

func (node *ModTreeNode) Walk(ctx context.Context, fn WalkFunc) error

type ModTreePath added in v0.19.11

type ModTreePath []string

func NewModTreePath added in v0.19.11

func NewModTreePath(s string) ModTreePath

func (ModTreePath) APICase added in v0.19.11

func (p ModTreePath) APICase() []string

func (ModTreePath) CliCase added in v0.19.11

func (p ModTreePath) CliCase() []string

func (ModTreePath) Contains added in v0.19.11

func (p ModTreePath) Contains(ctx context.Context, target ModTreePath) (result bool)

func (ModTreePath) Equals added in v0.19.11

func (p ModTreePath) Equals(ctx context.Context, other ModTreePath) (result bool)

func (ModTreePath) Glob added in v0.19.11

func (p ModTreePath) Glob(ctx context.Context, pattern string) (bool, error)

type ModType added in v0.9.7

type ModType interface {
	// ConvertFromSDKResult converts a value returned from an SDK into values
	// expected by the server, including conversion of IDs to their "unpacked"
	// objects
	ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error)

	// ConvertToSDKInput converts a value from the server into a value expected
	// by the SDK, which may include converting objects to their IDs
	ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)

	// CollectContent walks the given value and hashes core object content and
	// primitive scalar values into the provided CollectedContent.
	CollectContent(ctx context.Context, value dagql.AnyResult, content *CollectedContent) error

	// SourceMod is the module in which this type was originally defined
	SourceMod() Mod

	// The core API TypeDef representation of this type
	TypeDef(context.Context) (dagql.ObjectResult[*TypeDef], error)
}

ModType wraps the core TypeDef type with schema specific concerns like ID conversion and tracking of the module in which the type was originally defined.

type ModelFinishedError added in v0.18.0

type ModelFinishedError struct {
	Reason string
}

func (*ModelFinishedError) Error added in v0.18.0

func (err *ModelFinishedError) Error() string

type ModelMessage added in v0.17.0

type ModelMessage struct {
	Role        string        `json:"role"`
	Content     string        `json:"content"`
	ToolCalls   []LLMToolCall `json:"tool_calls,omitempty"`
	ToolCallID  string        `json:"tool_call_id,omitempty"`
	ToolErrored bool          `json:"tool_errored,omitempty"`
	TokenUsage  LLMTokenUsage `json:"token_usage,omitzero"`
}

ModelMessage represents a generic message in the LLM conversation

type Module added in v0.8.8

type Module struct {
	// The source of the module
	Source dagql.Nullable[dagql.ObjectResult[*ModuleSource]] `field:"true" name:"source" doc:"The source for the module."`

	// The source to load contextual dirs/files from, which may be different than Source for blueprints or toolchains.
	ContextSource dagql.Nullable[dagql.ObjectResult[*ModuleSource]]

	// The name of the module
	NameField string `field:"true" name:"name" doc:"The name of the module"`

	// The original name of the module set in its configuration file (or first configured via withName).
	// Different than NameField when a different name was specified for the module via a dependency.
	OriginalName string

	// The module's SDKConfig, as set in the module config file
	SDKConfig *SDKConfig `field:"true" name:"sdk" doc:"The SDK config used by this module."`

	// Deps contains the module's dependency DAG.
	Deps *SchemaBuilder

	// Runtime is the container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
	Runtime dagql.Nullable[dagql.ObjectResult[*Container]]

	// The doc string of the module, if any
	Description string `field:"true" doc:"The doc string of the module, if any"`

	// The module's objects
	ObjectDefs dagql.ObjectResultArray[*TypeDef] `field:"true" name:"objects" doc:"Objects served by this module."`

	// The module's interfaces
	InterfaceDefs dagql.ObjectResultArray[*TypeDef] `field:"true" name:"interfaces" doc:"Interfaces served by this module."`

	// The module's enumerations
	EnumDefs dagql.ObjectResultArray[*TypeDef] `field:"true" name:"enums" doc:"Enumerations served by this module."`

	IncludeSelfInDeps bool

	// If true, disable the new default function caching behavior for this module. Functions will
	// instead default to the old behavior of per-session caching.
	DisableDefaultFunctionCaching bool

	// LegacyDefaultPath, when true, causes +defaultPath to resolve relative to
	// the workspace root instead of the module's own source directory.
	// Used for legacy blueprints/toolchains migrated to workspace modules.
	LegacyDefaultPath bool

	// Config values from workspace config.toml [modules.<name>.config].
	// Typed map: strings, bools, ints, floats as-is from TOML.
	// When set, constructor args are resolved from this map first.
	WorkspaceConfig map[string]any

	// When true and WorkspaceConfig is set, also load .env defaults
	// for args not found in WorkspaceConfig. Off by default.
	DefaultsFromDotEnv bool

	// Salts the module content cache key with internal asModule options that
	// can materially change the resulting module instance for the same source.
	AsModuleVariantDigest string
}

func (*Module) ApplyLegacyCustomizationsToTypeDefs added in v0.20.4

func (mod *Module) ApplyLegacyCustomizationsToTypeDefs(ctx context.Context, dag *dagql.Server, customizations []*modules.ModuleConfigArgument) error

func (*Module) ApplyWorkspaceDefaultsToTypeDefs added in v0.20.4

func (mod *Module) ApplyWorkspaceDefaultsToTypeDefs(ctx context.Context, dag *dagql.Server) error

ApplyWorkspaceDefaultsToTypeDefs updates constructor arg typedefs based on WorkspaceConfig, so that --help displays the correct default values. For primitive types (string, int, bool, float), it sets arg.DefaultValue to the JSON representation. For object types (Secret, Directory, etc.), it marks the arg as optional (since a default will be resolved at call time).

func (*Module) AttachDependencyResults added in v0.21.0

func (mod *Module) AttachDependencyResults(
	ctx context.Context,
	self dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (Module) Clone added in v0.8.8

func (mod Module) Clone() *Module

func (Module) CloneWithoutDefs added in v0.16.3

func (mod Module) CloneWithoutDefs() *Module

func (*Module) DecodePersistedObject added in v0.21.0

func (*Module) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*Module) EncodePersistedObject added in v0.21.0

func (mod *Module) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Module) Evaluate added in v0.16.0

func (mod *Module) Evaluate(context.Context) error

func (*Module) GetContextSource added in v0.19.1

func (mod *Module) GetContextSource() *ModuleSource

The "context source" is the module used as the execution context for the module. Usually it's simply the module source itself. But when using blueprints or toolchains, it will point to the downstream module applying the toolchain, not the toolchain itself.

func (*Module) GetSource added in v0.18.3

func (mod *Module) GetSource() *ModuleSource

func (*Module) LoadRuntime added in v0.19.4

func (mod *Module) LoadRuntime(ctx context.Context) (ModuleRuntime, error)

func (*Module) MainObject added in v0.19.7

func (mod *Module) MainObject() (*ObjectTypeDef, bool)

func (*Module) Name added in v0.8.8

func (mod *Module) Name() string

func (*Module) ObjectByName added in v0.19.7

func (mod *Module) ObjectByName(name string) (*ObjectTypeDef, bool)

func (*Module) ObjectByOriginalName added in v0.20.4

func (mod *Module) ObjectByOriginalName(name string) (*ObjectTypeDef, bool)

ObjectByOriginalName finds an object by comparing against its OriginalName (as registered by the SDK), rather than the potentially-namespaced Name. This is needed because namespaceObject rewrites obj.Name to match the module's final name, but obj.OriginalName always reflects the SDK name.

func (*Module) ObjectUserDefaults added in v0.19.1

func (mod *Module) ObjectUserDefaults(ctx context.Context, objName string) (*EnvFile, error)

Return local defaults for the specified object An empty string as object name means the constructor.

func (*Module) Patch added in v0.18.12

func (mod *Module) Patch(ctx context.Context) error

Patch is called after all types have been loaded - here we can update any definitions as required, and attempt to resolve references.

func (*Module) RuntimeContainer added in v0.20.2

func (mod *Module) RuntimeContainer() dagql.Nullable[dagql.ObjectResult[*Container]]

func (*Module) Sync added in v0.21.0

func (mod *Module) Sync(ctx context.Context) error

func (*Module) Type added in v0.9.7

func (*Module) Type() *ast.Type

func (*Module) TypeDefs added in v0.9.7

func (mod *Module) TypeDefs(ctx context.Context, dag *dagql.Server) (dagql.ObjectResultArray[*TypeDef], error)

func (*Module) TypeDescription added in v0.9.7

func (*Module) TypeDescription() string

func (*Module) UserDefaults added in v0.19.1

func (mod *Module) UserDefaults(ctx context.Context) (*EnvFile, error)

Return all user defaults for this module

func (*Module) View added in v0.12.0

func (mod *Module) View() (call.View, bool)

func (*Module) WithDescription added in v0.9.8

func (mod *Module) WithDescription(desc string) *Module

func (*Module) WithEnum added in v0.12.0

func (mod *Module) WithEnum(ctx context.Context, def dagql.ObjectResult[*TypeDef]) (*Module, error)

func (*Module) WithInterface added in v0.9.6

func (mod *Module) WithInterface(ctx context.Context, def dagql.ObjectResult[*TypeDef]) (*Module, error)

func (*Module) WithObject added in v0.8.8

func (mod *Module) WithObject(ctx context.Context, def dagql.ObjectResult[*TypeDef]) (*Module, error)

type ModuleEnum added in v0.12.0

type ModuleEnum struct {
	TypeDef *EnumTypeDef
	Name    string

	// Local marks this enum value as local to the module that declares its
	// typedef. This is so that when converting it to/from it's own module we
	// can use its OriginalName, but when converting it for other modules, we
	// use the declared Name.
	Local bool
}

func (*ModuleEnum) DecodeInput added in v0.12.0

func (e *ModuleEnum) DecodeInput(val any) (dagql.Input, error)

func (*ModuleEnum) Decoder added in v0.12.0

func (e *ModuleEnum) Decoder() dagql.InputDecoder

func (*ModuleEnum) Install added in v0.12.0

func (e *ModuleEnum) Install(dag *dagql.Server) error

func (*ModuleEnum) Lookup added in v0.12.0

func (e *ModuleEnum) Lookup(val string) (dagql.Input, error)

func (*ModuleEnum) MarshalJSON added in v0.12.0

func (e *ModuleEnum) MarshalJSON() ([]byte, error)

func (*ModuleEnum) PossibleValues added in v0.12.0

func (e *ModuleEnum) PossibleValues() ast.EnumValueList

func (*ModuleEnum) ToLiteral added in v0.12.0

func (e *ModuleEnum) ToLiteral() call.Literal

func (*ModuleEnum) Type added in v0.12.0

func (e *ModuleEnum) Type() *ast.Type

func (*ModuleEnum) TypeDefinition added in v0.12.0

func (e *ModuleEnum) TypeDefinition(view call.View) *ast.Definition

func (*ModuleEnum) TypeDescription added in v0.12.0

func (e *ModuleEnum) TypeDescription() string

func (*ModuleEnum) TypeName added in v0.12.0

func (e *ModuleEnum) TypeName() string

type ModuleEnumType added in v0.12.0

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

func (*ModuleEnumType) CollectContent added in v0.20.0

func (m *ModuleEnumType) CollectContent(ctx context.Context, value dagql.AnyResult, content *CollectedContent) error

func (*ModuleEnumType) ConvertFromSDKResult added in v0.12.0

func (m *ModuleEnumType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error)

func (*ModuleEnumType) ConvertToSDKInput added in v0.12.0

func (m *ModuleEnumType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)

func (*ModuleEnumType) SourceMod added in v0.12.0

func (m *ModuleEnumType) SourceMod() Mod

func (*ModuleEnumType) TypeDef added in v0.12.0

type ModuleExecError added in v0.21.0

type ModuleExecError struct {
	Err     error
	ErrorID dagql.ID[*Error]
}

func (*ModuleExecError) Error added in v0.21.0

func (e *ModuleExecError) Error() string

func (*ModuleExecError) Unwrap added in v0.21.0

func (e *ModuleExecError) Unwrap() error

type ModuleFunction added in v0.9.7

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

func NewModFunction added in v0.16.0

func NewModFunction(
	ctx context.Context,
	mod dagql.ObjectResult[*Module],
	objDef *ObjectTypeDef,
	metadata *Function,
) (*ModuleFunction, error)

func (*ModuleFunction) ArgType added in v0.9.7

func (fn *ModuleFunction) ArgType(argName string) (ModType, error)

func (*ModuleFunction) Call added in v0.9.7

func (fn *ModuleFunction) Call(ctx context.Context, opts *CallOpts) (t dagql.AnyResult, rerr error)

func (*ModuleFunction) DynamicInputsForCall added in v0.21.0

func (fn *ModuleFunction) DynamicInputsForCall(
	ctx context.Context,
	parent dagql.AnyResult,
	args map[string]dagql.Input,
	view call.View,
	req *dagql.CallRequest,
) error

func (*ModuleFunction) ReturnType added in v0.9.7

func (fn *ModuleFunction) ReturnType() (ModType, error)

func (*ModuleFunction) UserDefault added in v0.19.1

func (fn *ModuleFunction) UserDefault(ctx context.Context, argName string) (*UserDefault, bool, error)

Lookup a user default for this function

func (*ModuleFunction) UserDefaults added in v0.19.1

func (fn *ModuleFunction) UserDefaults(ctx context.Context) (*EnvFile, error)

type ModuleID added in v0.8.8

type ModuleID = dagql.ID[*Module]

type ModuleObject added in v0.9.7

type ModuleObject struct {
	Module dagql.ObjectResult[*Module]

	TypeDef *ObjectTypeDef
	Fields  map[string]any
}

func (*ModuleObject) AttachDependencyResults added in v0.21.0

func (obj *ModuleObject) AttachDependencyResults(
	ctx context.Context,
	self dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*ModuleObject) DecodePersistedObject added in v0.21.0

func (obj *ModuleObject) DecodePersistedObject(
	ctx context.Context,
	dag *dagql.Server,
	_ uint64,
	_ *dagql.ResultCall,
	jsonBytes json.RawMessage,
) (dagql.Typed, error)

func (*ModuleObject) EncodePersistedObject added in v0.21.0

func (obj *ModuleObject) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*ModuleObject) Install added in v0.9.7

func (obj *ModuleObject) Install(ctx context.Context, dag *dagql.Server, opts ...InstallOpts) error

func (*ModuleObject) Type added in v0.9.7

func (obj *ModuleObject) Type() *ast.Type

func (*ModuleObject) TypeDefinition added in v0.13.7

func (obj *ModuleObject) TypeDefinition(view call.View) *ast.Definition

func (*ModuleObject) TypeDescription added in v0.9.7

func (obj *ModuleObject) TypeDescription() string

type ModuleObjectType added in v0.9.7

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

func (*ModuleObjectType) CollectContent added in v0.20.0

func (t *ModuleObjectType) CollectContent(ctx context.Context, value dagql.AnyResult, content *CollectedContent) error

func (*ModuleObjectType) ConvertFromSDKResult added in v0.9.7

func (t *ModuleObjectType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error)

func (*ModuleObjectType) ConvertToSDKInput added in v0.9.7

func (t *ModuleObjectType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)

func (*ModuleObjectType) GetCallable added in v0.9.7

func (t *ModuleObjectType) GetCallable(ctx context.Context, name string) (Callable, error)

func (*ModuleObjectType) SourceMod added in v0.9.7

func (t *ModuleObjectType) SourceMod() Mod

func (*ModuleObjectType) TypeDef added in v0.9.7

type ModuleRelationType added in v0.19.4

type ModuleRelationType int

ModuleRelationType distinguishes between dependencies and toolchains in error messages and field access for ModuleSource authoring mutations.

const (
	ModuleRelationTypeDependency ModuleRelationType = iota
	ModuleRelationTypeToolchain
)

func (ModuleRelationType) Plural added in v0.19.4

func (t ModuleRelationType) Plural() string

func (ModuleRelationType) String added in v0.19.4

func (t ModuleRelationType) String() string

type ModuleRuntime added in v0.20.2

type ModuleRuntime interface {
	// AsContainer returns the runtime as a Container, if applicable.
	// Returns false if this runtime doesn't use containers.
	AsContainer() (dagql.ObjectResult[*Container], bool)

	// Call executes a function call in this runtime.
	// The runtime is responsible for preparing the execution environment,
	// running the function, and returning the result.
	// Returns the output bytes and the client ID that was used for execution.
	Call(
		ctx context.Context,
		execMD *engineutil.ExecutionMetadata,
		fnCall *FunctionCall,
		moduleContext dagql.ObjectResult[*Module],
		envContext dagql.ObjectResult[*Env],
	) (outputBytes []byte, err error)
}

ModuleRuntime is an abstraction over different ways to execute module code.

This can be either: - A Container-based runtime (traditional SDKs) - A native execution environment (e.g., Dang running directly in the engine)

type ModuleSource added in v0.9.8

type ModuleSource struct {
	ConfigExists                  bool   `field:"true" name:"configExists" doc:"Whether an existing dagger.json for the module was found."`
	ModuleName                    string `field:"true" name:"moduleName" doc:"The name of the module, including any setting via the withName API."`
	ModuleOriginalName            string `` /* 165-byte string literal not displayed */
	EngineVersion                 string `field:"true" name:"engineVersion" doc:"The engine version of the module."`
	CodegenConfig                 *modules.ModuleCodegenConfig
	ModuleConfigUserFields        modules.ModuleConfigUserFields
	DisableDefaultFunctionCaching bool

	// The SDK configuration of the module as read from the module's dagger.json or set by withSDK
	SDK *SDKConfig `field:"true" name:"sdk" doc:"The SDK configuration of the module."`
	// The implementation of the SDK with codegen and related operations. Reloaded when SDK changes.
	SDKImpl SDK

	// IncludePaths are the includes as read from the module's dagger.json
	IncludePaths []string
	// RebasedIncludePaths are the include paths with the source root subpath prepended
	RebasedIncludePaths []string

	// ConfigDependencies are the dependencies as read from the module's dagger.json
	// NOTE: this is currently not updated by withDependencies and related APIs, only Dependencies will be updated
	ConfigDependencies []*modules.ModuleConfigDependency

	// Dependencies are the loaded sources for the module's dependencies
	Dependencies dagql.ObjectResultArray[*ModuleSource] `field:"true" name:"dependencies" doc:"The dependencies of the module source."`

	// Blueprint (from `dagger init --blueprint`)
	ConfigBlueprint *modules.ModuleConfigDependency
	Blueprint       dagql.ObjectResult[*ModuleSource] `field:"true" name:"blueprint" doc:"The blueprint referenced by the module source."`

	// Toolchains (from `dagger toolchain install`)
	ConfigToolchains []*modules.ModuleConfigDependency
	Toolchains       dagql.ObjectResultArray[*ModuleSource] `field:"true" name:"toolchains" doc:"The toolchains referenced by the module source."`

	// Internal-only projection metadata used by schema helpers to load this
	// module source as a toolchain in the context of a parent module source.
	ToolchainContextSource dagql.Nullable[dagql.ObjectResult[*ModuleSource]]
	ToolchainConfigIndex   int
	ToolchainProjection    bool

	UserDefaults *EnvFile `field:"true" name:"userDefaults" doc:"User-defined defaults read from local .env files"`
	// Clients are the clients generated for the module.
	ConfigClients []*modules.ModuleConfigClient `field:"true" name:"configClients" doc:"The clients generated for the module."`

	// SourceRootSubpath is the relative path from the context dir to the dir containing the module's dagger.json
	SourceRootSubpath string `` /* 128-byte string literal not displayed */
	// SourceSubpath is the relative path from the context dir to the dir containing the module's source code
	SourceSubpath string

	OriginalSubpath string

	ContextDirectory dagql.ObjectResult[*Directory] `` /* 136-byte string literal not displayed */

	Kind   ModuleSourceKind `field:"true" name:"kind" doc:"The kind of module source (currently local, git or dir)."`
	Local  *LocalModuleSource
	Git    *GitModuleSource
	DirSrc *DirModuleSource
}

func (*ModuleSource) AsString added in v0.16.0

func (src *ModuleSource) AsString() string

func (*ModuleSource) AttachDependencyResults added in v0.21.0

func (src *ModuleSource) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (ModuleSource) Clone added in v0.9.8

func (src ModuleSource) Clone() *ModuleSource

func (*ModuleSource) DecodePersistedObject added in v0.21.0

func (*ModuleSource) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*ModuleSource) EncodePersistedObject added in v0.21.0

func (src *ModuleSource) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*ModuleSource) Evaluate added in v0.16.0

func (src *ModuleSource) Evaluate(context.Context) error

func (*ModuleSource) GetRelatedModules added in v0.19.4

func (src *ModuleSource) GetRelatedModules(typ ModuleRelationType) []dagql.ObjectResult[*ModuleSource]

GetRelatedModules returns the related modules (dependencies or toolchains) based on the type.

func (*ModuleSource) LoadContextDir added in v0.18.17

func (src *ModuleSource) LoadContextDir(
	ctx context.Context,
	dag *dagql.Server,
	path string,
	filter CopyFilter,
) (inst dagql.ObjectResult[*Directory], err error)

LoadContextDir loads addition files+directories from the module source's context, including those that may have not been included in the original module source load.

func (*ModuleSource) LoadContextFile added in v0.19.3

func (src *ModuleSource) LoadContextFile(
	ctx context.Context,
	dag *dagql.Server,
	path string,
) (inst dagql.ObjectResult[*File], err error)

func (*ModuleSource) LoadContextGit added in v0.18.17

func (src *ModuleSource) LoadContextGit(
	ctx context.Context,
	dag *dagql.Server,
) (inst dagql.ObjectResult[*GitRepository], err error)

func (*ModuleSource) LoadUserDefaults added in v0.19.1

func (src *ModuleSource) LoadUserDefaults(ctx context.Context) (rerr error)

LoadUserDefaults loads and merges environment files for local module defaults. It combines the inner .env file (from the module's source root) with relevant entries from the outer .env file (found via find-up from the host), filtered by the module name and original module name as prefixes.

Example: Inner .env (mymodule/.env): FOO=bar Outer .env (found via find-up): MYMODULE_BAZ=qux, OTHER_VAR=ignored Result: FOO=bar, BAZ=qux (prefix "MYMODULE_" removed from outer entries)

func (*ModuleSource) Pin added in v0.13.6

func (src *ModuleSource) Pin() string

func (*ModuleSource) SetRelatedModules added in v0.19.4

func (src *ModuleSource) SetRelatedModules(typ ModuleRelationType, modules []dagql.ObjectResult[*ModuleSource])

SetRelatedModules sets the related modules (dependencies or toolchains) based on the type.

func (*ModuleSource) SourceImplementationDigest added in v0.21.0

func (src *ModuleSource) SourceImplementationDigest(ctx context.Context) (digest.Digest, error)

SourceImplementationDigest calculates a content-hash of the module source's implementation. Two module sources with the same digest should share implementation-scoped cache identity for SDK operations and module function calls even if they came from different client-specific sources.

func (*ModuleSource) Sync added in v0.21.0

func (src *ModuleSource) Sync(ctx context.Context) error

func (*ModuleSource) Type added in v0.9.8

func (src *ModuleSource) Type() *ast.Type

func (*ModuleSource) TypeDescription added in v0.9.8

func (src *ModuleSource) TypeDescription() string

type ModuleSourceExperimentalFeature added in v0.19.3

type ModuleSourceExperimentalFeature string

func (ModuleSourceExperimentalFeature) Decoder added in v0.19.3

func (ModuleSourceExperimentalFeature) String added in v0.19.3

func (ModuleSourceExperimentalFeature) ToLiteral added in v0.19.3

func (ModuleSourceExperimentalFeature) Type added in v0.19.3

func (ModuleSourceExperimentalFeature) TypeDescription added in v0.19.3

func (f ModuleSourceExperimentalFeature) TypeDescription() string

type ModuleSourceID added in v0.9.8

type ModuleSourceID = dagql.ID[*ModuleSource]

type ModuleSourceKind added in v0.9.8

type ModuleSourceKind string

func FastModuleSourceKindCheck added in v0.20.4

func FastModuleSourceKindCheck(
	refString string,
	refPin string,
) ModuleSourceKind

FastModuleSourceKindCheck performs a quick heuristic check to determine whether a module ref string refers to a local path or a git source. Returns "" if the kind cannot be determined without further inspection.

func (ModuleSourceKind) Decoder added in v0.9.8

func (proto ModuleSourceKind) Decoder() dagql.InputDecoder

func (ModuleSourceKind) HumanString added in v0.16.0

func (proto ModuleSourceKind) HumanString() string

func (ModuleSourceKind) ToLiteral added in v0.9.8

func (proto ModuleSourceKind) ToLiteral() call.Literal

func (ModuleSourceKind) Type added in v0.9.8

func (proto ModuleSourceKind) Type() *ast.Type

func (ModuleSourceKind) TypeDescription added in v0.9.8

func (proto ModuleSourceKind) TypeDescription() string

type ModuleSourceStatFS added in v0.18.7

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

func (ModuleSourceStatFS) Exists added in v0.20.4

func (fs ModuleSourceStatFS) Exists(ctx context.Context, path string) (string, bool, error)

func (ModuleSourceStatFS) Stat added in v0.18.7

func (fs ModuleSourceStatFS) Stat(ctx context.Context, path string) (string, *Stat, error)

type ModuleTypes added in v0.19.3

type ModuleTypes interface {
	/*
		ModuleTypes returns a module instance representing the type definitions
		exposed by the module code.

		This function prototype is different from the one exposed by the SDK.
			SDK must implement the `ModuleTypes` function with the following signature:

			“`gql
			  moduleTypes(
			    modSource: ModuleSource!
			    introspectionJSON: File!
				outputFilePath: String!
			  ): Container!
			“`
	*/
	ModuleTypes(
		context.Context,

		*SchemaBuilder,

		dagql.ObjectResult[*ModuleSource],

		*Module,
	) (dagql.ObjectResult[*Module], error)
}

ModuleTypes is an interface that a SDK may implement to expose type definitions of the module.

This interface MUST be implemented to support self calls.

type NetworkProtocol added in v0.3.13

type NetworkProtocol string

NetworkProtocol is a GraphQL enum type.

func (NetworkProtocol) Decoder added in v0.9.7

func (proto NetworkProtocol) Decoder() dagql.InputDecoder

func (NetworkProtocol) Network added in v0.3.13

func (proto NetworkProtocol) Network() string

Network returns the value appropriate for the "network" argument to Go net.Dial, and for appending to the port number to form the key for the ExposedPorts object in the OCI image config.

func (NetworkProtocol) ToLiteral added in v0.9.7

func (proto NetworkProtocol) ToLiteral() call.Literal

func (NetworkProtocol) Type added in v0.9.7

func (proto NetworkProtocol) Type() *ast.Type

func (NetworkProtocol) TypeDescription added in v0.9.7

func (proto NetworkProtocol) TypeDescription() string

type NullableType added in v0.9.7

type NullableType struct {
	InnerDef dagql.ObjectResult[*TypeDef]
	Inner    ModType
}

func (*NullableType) CollectContent added in v0.20.0

func (t *NullableType) CollectContent(ctx context.Context, value dagql.AnyResult, content *CollectedContent) error

func (*NullableType) ConvertFromSDKResult added in v0.9.7

func (t *NullableType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error)

func (*NullableType) ConvertToSDKInput added in v0.9.7

func (t *NullableType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)

func (*NullableType) SourceMod added in v0.9.7

func (t *NullableType) SourceMod() Mod

func (*NullableType) TypeDef added in v0.9.7

type ObjectTypeDef added in v0.8.8

type ObjectTypeDef struct {
	// Name is the standardized name of the object (CamelCase), as used for the object in the graphql schema
	Name        string                                         `field:"true" doc:"The name of the object." doNotCache:"simple field selection"`
	Description string                                         `field:"true" doc:"The doc string for the object, if any." doNotCache:"simple field selection"`
	SourceMap   dagql.Nullable[dagql.ObjectResult[*SourceMap]] `field:"true" doc:"The location of this object declaration."`
	Fields      dagql.ObjectResultArray[*FieldTypeDef]
	Functions   dagql.ObjectResultArray[*Function]
	Constructor dagql.Nullable[dagql.ObjectResult[*Function]]
	Deprecated  *string `field:"true" doc:"The reason this enum member is deprecated, if any."`

	// SourceModuleName is currently only set when returning the TypeDef from the Objects field on Module
	SourceModuleName string `` /* 146-byte string literal not displayed */

	// The original name of the object as provided by the SDK that defined it, used
	// when invoking the SDK so it doesn't need to think as hard about case conversions
	OriginalName string

	// IsMainObject is true when this object is the primary (entry-point)
	// object of its source module, as determined by Module.MainObject().
	// Set by Module.TypeDefs() so downstream consumers don't need
	// name-matching heuristics.
	IsMainObject bool
}

func NewObjectTypeDef added in v0.9.1

func NewObjectTypeDef(name, description string, deprecated *string) *ObjectTypeDef

func (*ObjectTypeDef) AttachDependencyResults added in v0.21.0

func (obj *ObjectTypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (ObjectTypeDef) Clone added in v0.8.8

func (obj ObjectTypeDef) Clone() *ObjectTypeDef

func (*ObjectTypeDef) DecodePersistedObject added in v0.21.0

func (*ObjectTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*ObjectTypeDef) EncodePersistedObject added in v0.21.0

func (obj *ObjectTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*ObjectTypeDef) FieldByName added in v0.8.8

func (obj *ObjectTypeDef) FieldByName(name string) (*FieldTypeDef, bool)

func (*ObjectTypeDef) FieldByOriginalName added in v0.9.7

func (obj *ObjectTypeDef) FieldByOriginalName(name string) (*FieldTypeDef, bool)

func (*ObjectTypeDef) FunctionByName added in v0.8.8

func (obj *ObjectTypeDef) FunctionByName(name string) (*Function, bool)

func (*ObjectTypeDef) IsSubtypeOf added in v0.9.6

func (obj *ObjectTypeDef) IsSubtypeOf(iface *InterfaceTypeDef) bool

func (*ObjectTypeDef) Type added in v0.9.7

func (*ObjectTypeDef) Type() *ast.Type

func (*ObjectTypeDef) TypeDescription added in v0.9.7

func (*ObjectTypeDef) TypeDescription() string

func (*ObjectTypeDef) WithConstructor added in v0.21.0

func (obj *ObjectTypeDef) WithConstructor(fn dagql.ObjectResult[*Function]) *ObjectTypeDef

func (*ObjectTypeDef) WithField added in v0.21.0

func (obj *ObjectTypeDef) WithField(field dagql.ObjectResult[*FieldTypeDef]) *ObjectTypeDef

func (*ObjectTypeDef) WithFunction added in v0.21.0

func (obj *ObjectTypeDef) WithFunction(fn dagql.ObjectResult[*Function]) *ObjectTypeDef

func (*ObjectTypeDef) WithName added in v0.21.0

func (obj *ObjectTypeDef) WithName(name string) *ObjectTypeDef

func (*ObjectTypeDef) WithSourceMap added in v0.13.7

func (obj *ObjectTypeDef) WithSourceMap(sourceMap dagql.ObjectResult[*SourceMap]) *ObjectTypeDef

func (*ObjectTypeDef) WithSourceModuleName added in v0.21.0

func (obj *ObjectTypeDef) WithSourceModuleName(sourceModuleName string) *ObjectTypeDef

type ObjectTypeDefID added in v0.21.0

type ObjectTypeDefID = dagql.ID[*ObjectTypeDef]

type OpenAIClient added in v0.17.0

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

func (*OpenAIClient) IsRetryable added in v0.18.4

func (c *OpenAIClient) IsRetryable(err error) bool

func (*OpenAIClient) SendQuery added in v0.17.0

func (c *OpenAIClient) SendQuery(ctx context.Context, history []*ModelMessage, tools []LLMTool) (_ *LLMResponse, rerr error)

type Ownership added in v0.5.1

type Ownership struct {
	UID int
	GID int
}

Ownership contains a UID/GID pair resolved from a user/group name or ID pair provided via the API. It primarily exists to distinguish an unspecified ownership from UID/GID 0 (root) ownership.

func ParseDirectoryOwner added in v0.21.0

func ParseDirectoryOwner(owner string) (*Ownership, error)

func ParseFileOwner added in v0.21.0

func ParseFileOwner(owner string) (*Ownership, error)

type ParsedGitRefString added in v0.18.7

type ParsedGitRefString struct {
	ModVersion string

	RepoRoot       *vcs.RepoRoot
	RepoRootSubdir string

	SourceCloneRef string // original user-provided username
	// contains filtered or unexported fields
}

func ParseGitRefString added in v0.18.7

func ParseGitRefString(ctx context.Context, refString string) (_ ParsedGitRefString, rerr error)

func (*ParsedGitRefString) GitRef added in v0.19.0

func (p *ParsedGitRefString) GitRef(
	ctx context.Context,
	dag *dagql.Server,
	pinCommitRef string,
) (inst dagql.ObjectResult[*GitRef], rerr error)

type ParsedLocalRefString added in v0.18.7

type ParsedLocalRefString struct {
	ModPath string
}

type ParsedRefString added in v0.18.7

type ParsedRefString struct {
	Kind  ModuleSourceKind
	Local *ParsedLocalRefString
	Git   *ParsedGitRefString
}

func ParseRefString added in v0.18.7

func ParseRefString(
	ctx context.Context,
	statFS StatFS,
	refString string,
	refPin string,
) (_ *ParsedRefString, rerr error)

type Platform added in v0.9.7

type Platform specs.Platform

func (Platform) DecodeInput added in v0.9.7

func (Platform) DecodeInput(val any) (dagql.Input, error)

func (Platform) Decoder added in v0.9.7

func (p Platform) Decoder() dagql.InputDecoder

func (Platform) Format added in v0.9.7

func (p Platform) Format() string

func (Platform) MarshalJSON added in v0.9.7

func (p Platform) MarshalJSON() ([]byte, error)

func (Platform) Spec added in v0.9.7

func (p Platform) Spec() specs.Platform

func (Platform) ToLiteral added in v0.9.7

func (p Platform) ToLiteral() call.Literal

func (Platform) Type added in v0.9.7

func (p Platform) Type() *ast.Type

func (Platform) TypeDescription added in v0.9.7

func (p Platform) TypeDescription() string

func (Platform) TypeName added in v0.9.7

func (p Platform) TypeName() string

func (*Platform) UnmarshalJSON added in v0.21.0

func (p *Platform) UnmarshalJSON(payload []byte) error

type Port added in v0.8.5

type Port struct {
	Port                        int             `field:"true" doc:"The port number."`
	Protocol                    NetworkProtocol `field:"true" doc:"The transport layer protocol."`
	Description                 *string         `field:"true" doc:"The port description."`
	ExperimentalSkipHealthcheck bool            `field:"true" doc:"Skip the health check when run as a service."`
}

Port configures a port to exposed from a container or service.

func NewPortFromOCI added in v0.18.15

func NewPortFromOCI(s string) (p Port, _ error)

NewPortFromOCI parses an OCI port spec (e.g. 8080/tcp) into a Port struct

func (Port) Type added in v0.9.7

func (Port) Type() *ast.Type

func (Port) TypeDescription added in v0.9.7

func (Port) TypeDescription() string

type PortForward added in v0.9.0

type PortForward struct {
	Frontend *int            `doc:"Port to expose to clients. If unspecified, a default will be chosen." json:"frontend,omitempty"`
	Backend  int             `doc:"Destination port for traffic." json:"backend"`
	Protocol NetworkProtocol `doc:"Transport layer protocol to use for traffic." default:"TCP" json:"protocol,omitempty"`
}

func ParsePortMapping added in v0.20.4

func ParsePortMapping(s string) (PortForward, error)

ParsePortMapping parses a Docker-like "hostPort:containerPort" string into a PortForward.

func (PortForward) FrontendOrBackendPort added in v0.9.0

func (pf PortForward) FrontendOrBackendPort() int

func (PortForward) TypeDescription added in v0.9.7

func (pf PortForward) TypeDescription() string

func (PortForward) TypeName added in v0.9.7

func (pf PortForward) TypeName() string

type PrimitiveType added in v0.9.7

type PrimitiveType struct {
	Def *TypeDef
}

PrimitiveType are the basic types like string, int, bool, void, etc.

func (*PrimitiveType) CollectContent added in v0.20.0

func (t *PrimitiveType) CollectContent(ctx context.Context, value dagql.AnyResult, content *CollectedContent) error

func (*PrimitiveType) ConvertFromSDKResult added in v0.9.7

func (t *PrimitiveType) ConvertFromSDKResult(ctx context.Context, value any) (dagql.AnyResult, error)

func (*PrimitiveType) ConvertToSDKInput added in v0.9.7

func (t *PrimitiveType) ConvertToSDKInput(ctx context.Context, value dagql.Typed) (any, error)

func (*PrimitiveType) SourceMod added in v0.9.7

func (t *PrimitiveType) SourceMod() Mod

func (*PrimitiveType) TypeDef added in v0.9.7

type Query added in v0.3.10

type Query struct {
	Server

	// ConstructorArgs stores arguments to pass to the entrypoint module's
	// constructor. Set by the `with` field on Query so that entrypoint
	// proxy resolvers can forward them to the constructor.
	ConstructorArgs map[string]dagql.Input
	// contains filtered or unexported fields
}

Query forms the root of the DAG and houses all necessary state and dependencies for evaluating queries.

func CurrentQuery added in v0.18.10

func CurrentQuery(ctx context.Context) (*Query, error)

func NewRoot added in v0.9.7

func NewRoot(srv Server) *Query

func (*Query) Clone added in v0.9.7

func (q *Query) Clone() *Query

func (*Query) ModDepsForCall added in v0.21.0

func (q *Query) ModDepsForCall(ctx context.Context, rootCall *dagql.ResultCall) (*SchemaBuilder, error)

ModDepsForCall loads the module dependencies referenced by the given result call.

func (*Query) NewHost added in v0.9.7

func (q *Query) NewHost() *Host

func (*Query) NewLLM added in v0.19.0

func (q *Query) NewLLM(ctx context.Context, model string, maxAPICalls int) (*LLM, error)

func (*Query) NewModule added in v0.9.7

func (q *Query) NewModule() *Module

func (*Query) RequireMainClient added in v0.12.0

func (q *Query) RequireMainClient(ctx context.Context) error

func (*Query) Type added in v0.9.7

func (*Query) Type() *ast.Type

func (*Query) TypeDescription added in v0.9.7

func (*Query) TypeDescription() string

func (*Query) WithPipeline added in v0.9.7

func (q *Query) WithPipeline(name, desc string) *Query

type RemoteGitMirror added in v0.21.0

type RemoteGitMirror struct {
	RemoteURL string
	// contains filtered or unexported fields
}

func NewRemoteGitMirror added in v0.21.0

func NewRemoteGitMirror(remoteURL string) *RemoteGitMirror

func (*RemoteGitMirror) CacheUsageIdentities added in v0.21.0

func (mirror *RemoteGitMirror) CacheUsageIdentities() []string

func (*RemoteGitMirror) CacheUsageMayChange added in v0.21.0

func (mirror *RemoteGitMirror) CacheUsageMayChange() bool

func (*RemoteGitMirror) CacheUsageSize added in v0.21.0

func (mirror *RemoteGitMirror) CacheUsageSize(ctx context.Context, identity string) (int64, bool, error)

func (*RemoteGitMirror) DecodePersistedObject added in v0.21.0

func (*RemoteGitMirror) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*RemoteGitMirror) EncodePersistedObject added in v0.21.0

func (mirror *RemoteGitMirror) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*RemoteGitMirror) EnsureCreated added in v0.21.0

func (mirror *RemoteGitMirror) EnsureCreated(ctx context.Context, query *Query) error

func (*RemoteGitMirror) OnRelease added in v0.21.0

func (mirror *RemoteGitMirror) OnRelease(ctx context.Context) error
func (mirror *RemoteGitMirror) PersistedSnapshotRefLinks() []dagql.PersistedSnapshotRefLink

func (*RemoteGitMirror) Type added in v0.21.0

func (*RemoteGitMirror) Type() *ast.Type

func (*RemoteGitMirror) TypeDescription added in v0.21.0

func (*RemoteGitMirror) TypeDescription() string

type RemoteGitRef added in v0.16.3

type RemoteGitRef struct {
	*gitutil.Ref
	// contains filtered or unexported fields
}

func (*RemoteGitRef) Tree added in v0.16.3

func (ref *RemoteGitRef) Tree(ctx context.Context, srv *dagql.Server, discardGitDir bool, depth int, includeTags bool) (_ *Directory, rerr error)

type RemoteGitRepository added in v0.16.3

type RemoteGitRepository struct {
	URL *gitutil.GitURL

	SSHKnownHosts string
	SSHAuthSocket dagql.ObjectResult[*Socket]

	Services ServiceBindings
	Platform Platform

	AuthUsername string
	AuthToken    dagql.ObjectResult[*Secret]
	AuthHeader   dagql.ObjectResult[*Secret]
	Mirror       dagql.ObjectResult[*RemoteGitMirror]
}

func (*RemoteGitRepository) Cleaned added in v0.19.4

func (repo *RemoteGitRepository) Cleaned(ctx context.Context) (inst dagql.ObjectResult[*Directory], _ error)

func (*RemoteGitRepository) Dirty added in v0.19.4

func (repo *RemoteGitRepository) Dirty(ctx context.Context) (inst dagql.ObjectResult[*Directory], _ error)

func (*RemoteGitRepository) Get added in v0.19.0

func (repo *RemoteGitRepository) Get(ctx context.Context, target *gitutil.Ref) (GitRefBackend, error)

func (*RemoteGitRepository) Remote added in v0.19.0

func (repo *RemoteGitRepository) Remote(ctx context.Context) (result *gitutil.Remote, rerr error)

type ReturnTypes added in v0.13.7

type ReturnTypes string

func (ReturnTypes) Decoder added in v0.13.7

func (expect ReturnTypes) Decoder() dagql.InputDecoder

func (ReturnTypes) ReturnCodes added in v0.13.7

func (expect ReturnTypes) ReturnCodes() []int

ReturnCodes gets the valid exit codes allowed for a specific return status

NOTE: exit status codes 128-191 are likely from exiting via a signal - we shouldn't try and handle these. Codes 192-255 are safe to handle to support tools that return exit codes >127, such as AWS CLI.

func (ReturnTypes) ToLiteral added in v0.13.7

func (expect ReturnTypes) ToLiteral() call.Literal

func (ReturnTypes) Type added in v0.13.7

func (expect ReturnTypes) Type() *ast.Type

func (ReturnTypes) TypeDescription added in v0.13.7

func (expect ReturnTypes) TypeDescription() string

type RunningService added in v0.8.5

type RunningService struct {
	// Key is the unique identifier for the service.
	Key ServiceKey

	// Host is the hostname used to reach the service.
	Host string

	// Ports lists the ports bound by the service.
	//
	// For a Container service, this is simply the list of exposed ports.
	//
	// For a TunnelService, this lists the configured port forwards with any
	// empty or 0 frontend ports resolved to their randomly selected host port.
	//
	// For a HostService, this lists the configured port forwards with any empty
	// or 0 frontend ports set to the same as the backend port.
	Ports []Port

	// Stop attempts to stop the service. It is normally called after all clients
	// have detached, but may also be called manually by the user. It may be
	// invoked concurrently, including with force=true to escalate an in-flight
	// graceful stop.
	Stop func(ctx context.Context, force bool) error

	// Wait blocks until the service has exited or the provided context is canceled.
	Wait func(ctx context.Context) error

	// Exec runs a command in the service. It is only supported for services
	// with a backing container.
	Exec func(ctx context.Context, cmd []string, env []string, io *ServiceIO) error

	// The runc container ID, if any
	ContainerID string
	// contains filtered or unexported fields
}

RunningService represents a service that is actively running.

func (*RunningService) ProtectRef added in v0.21.0

func (svc *RunningService) ProtectRef(ctx context.Context, ref bkcache.Ref) error

func (*RunningService) ReleaseTrackedRefs added in v0.21.0

func (svc *RunningService) ReleaseTrackedRefs(ctx context.Context) error

func (*RunningService) TrackRef added in v0.21.0

func (svc *RunningService) TrackRef(ctx context.Context, ref bkcache.Ref) error

type Runtime added in v0.18.7

type Runtime interface {
	/*
		Runtime returns an execution environment that is used to execute module code
		at runtime in the Dagger engine.

		The provided Module is not fully initialized; the Runtime field will not
		be set yet.

		This function prototype is different from the one exposed by the SDK.
		SDK must implement the `Runtime` function with the following signature:

		“`gql
		  moduleRuntime(
			  modSource: ModuleSource!
			  introspectionJSON: File!
		  ): Container!
		““
	*/
	Runtime(
		context.Context,

		*SchemaBuilder,

		dagql.ObjectResult[*ModuleSource],
	) (ModuleRuntime, error)
}

Runtime is an interface that a SDK may implements to provide an executable environment to run the module's code at runtime.

This include setup of the runtime environment, dependencies installation, and entrypoint setup.

For container-based runtimes, the returned ModuleRuntime should wrap a container with an entrypoint that will register the module typedefs in the Dagger engine or execute a function of that module depending on the argument forwarded to that entrypoint:

  • If the called object is empty, the script should register type definitions by sending a new ModuleID to the Dagger engine.
  • If the called object is set, the script should execute the corresponding function and send the result to the Dagger engine.

This interface MUST be implemented to support callable SDKs (`dagger call`).

type SDK added in v0.9.7

type SDK interface {
	// Transform the SDK into a Runtime if it implements it.
	AsRuntime() (Runtime, bool)

	// Transform the SDK into a ModuleTypes if it implements it.
	AsModuleTypes() (ModuleTypes, bool)

	// Transform the SDK into a CodeGenerator if it implements it.
	AsCodeGenerator() (CodeGenerator, bool)

	// Transform the SDK into a ClientGenerator if it implements it.
	AsClientGenerator() (ClientGenerator, bool)
}
  SDK aggregates all the interfaces that a SDK may implement.

	It provides conversion functions to get a specific interface if
	it's implemented.
	Otherwise, the function will return false.

	It works the same as type conversion in Go.

type SDKConfig added in v0.15.4

type SDKConfig struct {
	Source       string `` /* 150-byte string literal not displayed */
	Debug        bool   `field:"true" name:"debug" doc:"Whether to start the SDK runtime in debug mode with an interactive terminal."`
	Config       map[string]any
	Experimental map[string]bool
}

func (SDKConfig) Clone added in v0.15.4

func (sdk SDKConfig) Clone() *SDKConfig

func (*SDKConfig) ExperimentalFeatureEnabled added in v0.19.3

func (sdk *SDKConfig) ExperimentalFeatureEnabled(feature ModuleSourceExperimentalFeature) bool

func (*SDKConfig) Type added in v0.15.4

func (*SDKConfig) Type() *ast.Type

func (*SDKConfig) TypeDescription added in v0.15.4

func (*SDKConfig) TypeDescription() string

type ScalarTypeDef added in v0.11.3

type ScalarTypeDef struct {
	Name        string `field:"true" doc:"The name of the scalar." doNotCache:"simple field selection"`
	Description string `field:"true" doc:"A doc string for the scalar, if any." doNotCache:"simple field selection"`

	OriginalName string

	// SourceModuleName is currently only set when returning the TypeDef from the Scalars field on Module
	SourceModuleName string `` /* 146-byte string literal not displayed */
}

func NewScalarTypeDef added in v0.11.3

func NewScalarTypeDef(name, description string) *ScalarTypeDef

func (ScalarTypeDef) Clone added in v0.11.3

func (typeDef ScalarTypeDef) Clone() *ScalarTypeDef

func (*ScalarTypeDef) DecodePersistedObject added in v0.21.0

func (*ScalarTypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*ScalarTypeDef) EncodePersistedObject added in v0.21.0

func (typeDef *ScalarTypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*ScalarTypeDef) Type added in v0.11.3

func (*ScalarTypeDef) Type() *ast.Type

func (*ScalarTypeDef) TypeDescription added in v0.11.3

func (typeDef *ScalarTypeDef) TypeDescription() string

type ScalarTypeDefID added in v0.21.0

type ScalarTypeDefID = dagql.ID[*ScalarTypeDef]

type SchemaBuilder added in v0.20.4

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

SchemaBuilder lazily constructs a dagql server from a set of modules with per-module install policy. It is used both for a module's own dependency graph and for the set of modules served to a client session.

func NewSchemaBuilder added in v0.20.4

func NewSchemaBuilder(root *Query, mods []Mod) *SchemaBuilder

func (*SchemaBuilder) Append added in v0.20.4

func (b *SchemaBuilder) Append(mods ...Mod) *SchemaBuilder

func (*SchemaBuilder) Clone added in v0.20.4

func (b *SchemaBuilder) Clone() *SchemaBuilder

func (*SchemaBuilder) Lookup added in v0.20.4

func (b *SchemaBuilder) Lookup(name string) (Mod, bool)

func (*SchemaBuilder) ModTypeFor added in v0.20.4

func (b *SchemaBuilder) ModTypeFor(ctx context.Context, typeDef *TypeDef) (ModType, bool, error)

func (*SchemaBuilder) Mods added in v0.20.4

func (b *SchemaBuilder) Mods() []Mod

func (*SchemaBuilder) Prepend added in v0.20.4

func (b *SchemaBuilder) Prepend(mods ...Mod) *SchemaBuilder

func (*SchemaBuilder) PrimaryMods added in v0.20.4

func (b *SchemaBuilder) PrimaryMods() []Mod

func (*SchemaBuilder) Schema added in v0.21.0

func (b *SchemaBuilder) Schema(ctx context.Context) (*dagql.Server, error)

func (*SchemaBuilder) SchemaIntrospectionJSONFile added in v0.20.4

func (b *SchemaBuilder) SchemaIntrospectionJSONFile(ctx context.Context, hiddenTypes []string) (dagql.Result[*File], error)

func (*SchemaBuilder) SchemaIntrospectionJSONFileForClient added in v0.20.4

func (b *SchemaBuilder) SchemaIntrospectionJSONFileForClient(ctx context.Context) (dagql.Result[*File], error)

func (*SchemaBuilder) SchemaIntrospectionJSONFileForModule added in v0.20.4

func (b *SchemaBuilder) SchemaIntrospectionJSONFileForModule(ctx context.Context) (dagql.Result[*File], error)

func (*SchemaBuilder) TypeDefs added in v0.20.4

func (*SchemaBuilder) With added in v0.20.4

func (b *SchemaBuilder) With(mod Mod, opts InstallOpts) *SchemaBuilder

func (*SchemaBuilder) WithRoot added in v0.21.0

func (b *SchemaBuilder) WithRoot(root *Query) *SchemaBuilder

type SchemeType added in v0.12.6

type SchemeType int
const (
	NoScheme SchemeType = iota
	SchemeHTTP
	SchemeHTTPS
	SchemeSSH
	SchemeSCPLike
)

func (SchemeType) IsSSH added in v0.12.6

func (s SchemeType) IsSSH() bool

func (SchemeType) Prefix added in v0.12.6

func (s SchemeType) Prefix() string

type SearchOpts added in v0.18.17

type SearchOpts struct {
	Pattern     string
	Literal     bool `default:"false"`
	Multiline   bool `default:"false"`
	Dotall      bool `default:"false"`
	Insensitive bool `default:"false"`
	SkipIgnored bool `default:"false"`
	SkipHidden  bool `default:"false"`
	FilesOnly   bool `default:"false"`
	Limit       *int
}

func (SearchOpts) Args added in v0.18.17

func (opts SearchOpts) Args() []dagql.Argument

func (SearchOpts) RipgrepArgs added in v0.18.17

func (opts SearchOpts) RipgrepArgs() []string

func (*SearchOpts) RunRipgrep added in v0.18.17

func (opts *SearchOpts) RunRipgrep(ctx context.Context, rg *exec.Cmd, verbose bool) ([]*SearchResult, error)

type SearchResult added in v0.18.17

type SearchResult struct {
	FilePath       string            `field:"true" doc:"The path to the file that matched."`
	LineNumber     int               `field:"true" doc:"The first line that matched."`
	AbsoluteOffset int               `field:"true" doc:"The byte offset of this line within the file."`
	MatchedLines   string            `field:"true" doc:"The line content that matched."`
	Submatches     []*SearchSubmatch `field:"true" doc:"Sub-match positions and content within the matched lines."`
}

func (*SearchResult) DecodePersistedObject added in v0.21.0

func (*SearchResult) DecodePersistedObject(_ context.Context, _ *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*SearchResult) EncodePersistedObject added in v0.21.0

func (*SearchResult) Type added in v0.18.17

func (*SearchResult) Type() *ast.Type

type SearchSubmatch added in v0.18.17

type SearchSubmatch struct {
	Text  string `field:"true" doc:"The matched text."`
	Start int    `field:"true" doc:"The match's start offset within the matched lines."`
	End   int    `field:"true" doc:"The match's end offset within the matched lines."`
}

func (*SearchSubmatch) DecodePersistedObject added in v0.21.0

func (*SearchSubmatch) DecodePersistedObject(_ context.Context, _ *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*SearchSubmatch) EncodePersistedObject added in v0.21.0

func (*SearchSubmatch) Type added in v0.18.17

func (*SearchSubmatch) Type() *ast.Type

type Secret

type Secret struct {
	Handle         dagql.SessionResourceHandle
	URIVal         string
	NameVal        string
	PlaintextVal   []byte `json:"-"`
	SourceClientID string
}

Secret is a content-addressed secret.

func (*Secret) Clone added in v0.5.1

func (secret *Secret) Clone() *Secret

func (*Secret) DecodePersistedObject added in v0.21.0

func (*Secret) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, call *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*Secret) EncodePersistedObject added in v0.21.0

func (secret *Secret) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Secret) Name added in v0.5.1

func (secret *Secret) Name(ctx context.Context) (string, error)

func (*Secret) Plaintext

func (secret *Secret) Plaintext(ctx context.Context) ([]byte, error)

func (*Secret) Type added in v0.9.7

func (*Secret) Type() *ast.Type

func (*Secret) TypeDescription added in v0.9.7

func (*Secret) TypeDescription() string

func (*Secret) URI added in v0.18.3

func (secret *Secret) URI(ctx context.Context) (string, error)

type SecretID

type SecretID = dagql.ID[*Secret]

type Server added in v0.11.8

type Server interface {
	// Handle an HTTP request from a nested Dagger client.
	ServeHTTPToNestedClient(http.ResponseWriter, *http.Request, *engine.ClientMetadata, string, bool, dagql.AnyObjectResult, dagql.Typed, dagql.AnyObjectResult)

	// Stitch in the given module to the list being served to the current client
	ServeModule(ctx context.Context, mod dagql.ObjectResult[*Module], includeDependencies bool, entrypoint bool) error

	// If the current client is coming from a function, return the module that function is from
	CurrentModule(context.Context) (dagql.ObjectResult[*Module], error)

	// If the current client is a module client or a client created by a module function, returns that module.
	ModuleParent(context.Context) (dagql.ObjectResult[*Module], error)

	// If the current client is coming from a function, return the function call metadata
	CurrentFunctionCall(context.Context) (*FunctionCall, error)

	// If the current client is bound to an environment, return that environment.
	CurrentEnv(context.Context) (dagql.ObjectResult[*Env], error)

	// Return the modules being served to the current client
	CurrentServedDeps(context.Context) (*SchemaBuilder, error)

	// The Client metadata of the main client caller (i.e. the one who created
	// the session, typically the CLI invoked by the user)
	MainClientCallerMetadata(context.Context) (*engine.ClientMetadata, error)

	// Metadata about the main client, aka "non-module parent client", aka "NMPC".
	//
	// The NMPC is the nearest ancestor client that is not a module.
	// It is either a caller from the host like the CLI or a nested exec.
	// Useful for figuring out where local sources should be resolved from through
	// chains of dependency modules.
	NonModuleParentClientMetadata(context.Context) (*engine.ClientMetadata, error)

	// The cached workspace result from ensureWorkspaceLoaded.
	CurrentWorkspace(context.Context) (*Workspace, error)

	// A snapshot of the current workspace lockfile for ambient live locking.
	// Returns ok=false when lock-backed workspace access is unavailable.
	CurrentWorkspaceLock(context.Context) (*workspacepkg.Lock, bool, error)

	// Stage a lockfile lookup result for the current workspace's live lock state.
	SetCurrentWorkspaceLookup(context.Context, string, string, []any, workspacepkg.LookupResult) error

	// The Client metadata of a specific client ID within the same session as the
	// current client.
	SpecificClientMetadata(context.Context, string) (*engine.ClientMetadata, error)

	// The default deps of every user module (currently just core)
	DefaultDeps(context.Context) (*SchemaBuilder, error)

	// The telemetry seen-key store for the current client's session.
	TelemetrySeenKeyStore(context.Context) (dagql.TelemetrySeenKeyStore, error)

	// The DagQL server for the current client's session
	Server(context.Context) (*dagql.Server, error)

	// Mix in this http endpoint+handler to the current client's session
	MuxEndpoint(context.Context, string, http.Handler) error

	// The session attachables connection for a specific client ID within the
	// same session as the current client. Returns ok=false only when
	// opts.IfAvailable is set and the client has no active session attachables.
	SpecificClientAttachableConn(context.Context, string, SpecificClientAttachableConnOpts) (*grpc.ClientConn, bool, error)

	// The auth provider for the current client
	Auth(context.Context) (*auth.RegistryAuthProvider, error)

	// The engine utility client for the current client
	Engine(context.Context) (*engineutil.Client, error)

	// The session-owned registry resolver for the current client.
	RegistryResolver(context.Context) (*serverresolver.Resolver, error)

	// The services for the current client's session
	Services(context.Context) (*Services, error)

	// The default platform for the engine as a whole
	Platform() Platform

	// The content store for the engine as a whole
	OCIStore() content.Store

	// The builtin engine OCI source store.
	BuiltinOCIStore() content.Store

	// The dns configuration for the engine as a whole
	DNS() *oci.DNSConfig

	// The lease manager for the engine as a whole
	LeaseManager() *bkcache.LeaseManager

	// Return all the cache entries in the local cache. No support for filtering yet.
	EngineLocalCacheEntries(context.Context) (*EngineCacheEntrySet, error)

	// Prune the local cache of releaseable entries. If UseDefaultPolicy is true,
	// use the engine-wide default pruning policy, otherwise prune the whole cache
	// of any releasable entries.
	PruneEngineLocalCacheEntries(context.Context, EngineCachePruneOptions) (*EngineCacheEntrySet, error)

	// The default local cache policy to use for automatic local cache GC.
	EngineLocalCachePolicy() *dagql.CachePrunePolicy

	// Gets the engine snapshot manager.
	SnapshotManager() bkcache.SnapshotManager

	// A global lock for the engine, can be used to synchronize access to
	// shared resources between multiple potentially concurrent calls.
	Locker() *locker.Locker

	// A shared engine-wide salt used when creating cache keys for secrets based on their plaintext
	SecretSalt() []byte

	// Flush telemetry for all clients in the current session.
	FlushSessionTelemetry(ctx context.Context) error

	// Open a client's telemetry database.
	ClientTelemetry(ctc context.Context, sessID, clientID string) (*clientdb.DB, error)

	// The name of the engine
	EngineName() string

	// The list of connected client IDs
	Clients() []string

	// Return a client connected to a cloud engine. If bool return is false, the local engine should be used. Session attachables for the returned client will be proxied back to the calling client.
	CloudEngineClient(
		ctx context.Context,
		module string,
		function string,
		execCmd []string,
	) (
		cloudClient *engineclient.Client,
		useCloudClient bool,
		err error,
	)

	// A mount namespace guaranteed to not have any mounts created by engine operations.
	// Should be used when creating goroutines/processes that unshare a mount namespace,
	// otherwise those unshared mnt namespaces may inherit mounts from engine operations
	// and leak them.
	CleanMountNS() *os.File
}

APIs from the server+session+client that are needed by core APIs

type Service added in v0.3.13

type Service struct {
	// A custom hostname set by the user.
	CustomHostname string

	// Container is the container to run as a service.
	Container                     dagql.ObjectResult[*Container]
	Args                          []string
	ExperimentalPrivilegedNesting bool
	InsecureRootCapabilities      bool
	NoInit                        bool
	ExecMD                        *engineutil.ExecutionMetadata
	ModuleContext                 dagql.ObjectResult[*Module]
	ExecMeta                      *executor.Meta

	// TunnelUpstream is the service that this service is tunnelling to.
	TunnelUpstream dagql.ObjectResult[*Service]
	// TunnelPorts configures the port forwarding rules for the tunnel.
	TunnelPorts []PortForward

	// The sockets on the host to reverse tunnel
	HostSockets []*Socket
}

func (*Service) AttachDependencyResults added in v0.21.0

func (svc *Service) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*Service) Clone added in v0.8.5

func (svc *Service) Clone() *Service

Clone returns a deep copy of the container suitable for modifying in a WithXXX method.

func (*Service) DecodePersistedObject added in v0.21.0

func (*Service) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*Service) EncodePersistedObject added in v0.21.0

func (svc *Service) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Service) Endpoint added in v0.8.5

func (svc *Service) Endpoint(ctx context.Context, dig digest.Digest, port int, scheme string) (string, error)

func (*Service) Evaluate added in v0.18.17

func (svc *Service) Evaluate(ctx context.Context) error

func (*Service) Hostname added in v0.8.5

func (svc *Service) Hostname(ctx context.Context, dig digest.Digest) (string, error)

func (*Service) Ports added in v0.8.5

func (svc *Service) Ports(ctx context.Context, dig digest.Digest) ([]Port, error)

func (*Service) Start added in v0.8.5

func (svc *Service) Start(
	ctx context.Context,
	running *RunningService,
	dig digest.Digest,
	opts ServiceStartOpts,
) error

func (*Service) Stop added in v0.9.7

func (svc *Service) Stop(ctx context.Context, dig digest.Digest, kill bool) error

func (*Service) Sync added in v0.21.0

func (svc *Service) Sync(ctx context.Context) error

func (*Service) Terminal added in v0.18.17

func (*Service) Terminal(
	ctx context.Context,
	svc dagql.ObjectResult[*Service],
	args *ExecTerminalArgs,
) error

func (*Service) Type added in v0.9.7

func (*Service) Type() *ast.Type

func (*Service) TypeDescription added in v0.9.7

func (*Service) TypeDescription() string

func (*Service) WithHostname added in v0.13.4

func (svc *Service) WithHostname(hostname string) *Service

type ServiceBinding added in v0.8.5

type ServiceBinding struct {
	Service  dagql.ObjectResult[*Service]
	Hostname string
	Aliases  AliasSet
}

type ServiceBindings added in v0.3.13

type ServiceBindings []ServiceBinding

func (ServiceBindings) AttachDependencyResults added in v0.21.0

func (bndp ServiceBindings) AttachDependencyResults(
	owner string,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.DependencyResult, error)

func (*ServiceBindings) Merge added in v0.3.13

func (bndp *ServiceBindings) Merge(other ServiceBindings)

type ServiceID added in v0.8.5

type ServiceID = dagql.ID[*Service]

type ServiceIO added in v0.18.17

type ServiceIO struct {
	Stdin       io.ReadCloser
	Stdout      io.WriteCloser
	Stderr      io.WriteCloser
	ResizeCh    chan bkgw.WinSize
	Interactive bool
}

func (*ServiceIO) Close added in v0.18.17

func (io *ServiceIO) Close() error

type ServiceKey added in v0.8.5

type ServiceKey struct {
	Digest     digest.Digest
	SessionID  string
	ClientID   string
	Kind       ServiceRuntimeKind
	InstanceID string
}

type ServiceMCPConnection added in v0.19.0

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

func (*ServiceMCPConnection) Close added in v0.19.0

func (t *ServiceMCPConnection) Close() error

func (*ServiceMCPConnection) Read added in v0.19.0

Read implements [mcp.Connection.Read], assuming messages are newline-delimited JSON.

func (*ServiceMCPConnection) SessionID added in v0.19.0

func (t *ServiceMCPConnection) SessionID() string

func (*ServiceMCPConnection) Write added in v0.19.0

Write implements [mcp.Connection.Write], appending a newline delimiter after the message.

type ServiceMCPTransport added in v0.19.0

type ServiceMCPTransport struct {
	Service dagql.ObjectResult[*Service]
}

func (*ServiceMCPTransport) Connect added in v0.19.0

type ServiceRuntimeKind added in v0.21.0

type ServiceRuntimeKind string

ServiceKey is a unique identifier for a service.

const (
	ServiceRuntimeShared      ServiceRuntimeKind = "shared"
	ServiceRuntimeInteractive ServiceRuntimeKind = "interactive"
)

type ServiceStartOpts added in v0.21.0

type ServiceStartOpts struct {
	ClientSpecific bool
	IO             *ServiceIO

	// OriginSpanContexts are the install-span contexts of the API calls that
	// returned/own the Service value. When the service exits with an error,
	// these are linked as causal origins so the UI attributes the failure
	// back to the API span that created the service. The first valid one
	// also routes the service's stdio logs to its row.
	OriginSpanContexts []trace.SpanContext
}

type Services added in v0.8.5

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

Services manages the lifecycle of services, ensuring the same service only runs once per client.

func NewServices added in v0.8.5

func NewServices() *Services

NewServices returns a new Services.

func (*Services) Detach added in v0.8.5

func (ss *Services) Detach(ctx context.Context, svc *RunningService)

Detach detaches from the given service. If the service is not running, it is a no-op. If the service is running, it is stopped if there are no other clients using it.

func (*Services) Get added in v0.8.5

func (ss *Services) Get(ctx context.Context, dig digest.Digest, clientSpecific bool) (*RunningService, error)

Get returns the running service for the given service. If the service is starting, it waits for it and either returns the running service or an error if it failed to start. If the service is not running or starting, an error is returned.

func (*Services) Start added in v0.8.5

func (ss *Services) Start(ctx context.Context, dig digest.Digest, svc Startable, clientSpecific bool) (*RunningService, error)

Start starts the given service, returning the running service. If the service is already running, it is returned immediately. If the service is already starting, it waits for it to finish and returns the running service. If the service failed to start, it tries again.

func (*Services) StartBindings added in v0.8.5

func (ss *Services) StartBindings(ctx context.Context, bindings ServiceBindings) (_ func(), _ []*RunningService, err error)

StartBindings starts each of the bound services in parallel and returns a function that will detach from all of them after 10 seconds.

func (*Services) StartInteractive added in v0.21.0

func (ss *Services) StartInteractive(
	ctx context.Context,
	dig digest.Digest,
	svc Startable,
	sio *ServiceIO,
) (_ *RunningService, release func(), err error)

func (*Services) StartResult added in v0.21.0

func (ss *Services) StartResult(ctx context.Context, svc dagql.ObjectResult[*Service], clientSpecific bool) (*RunningService, error)

func (*Services) StartResultWithDependencyExitPropagationSuppressed added in v0.21.0

func (ss *Services) StartResultWithDependencyExitPropagationSuppressed(
	ctx context.Context,
	svc dagql.ObjectResult[*Service],
) (_ *RunningService, release func(), _ error)

StartResultWithDependencyExitPropagationSuppressed starts a shared service while deferring dependency-exit propagation until the returned release is called.

func (*Services) StartResultWithIO added in v0.21.0

func (ss *Services) StartResultWithIO(
	ctx context.Context,
	svc dagql.ObjectResult[*Service],
	clientSpecific bool,
	sio *ServiceIO,
) (*RunningService, error)

func (*Services) StartResultWithOpts added in v0.21.0

func (ss *Services) StartResultWithOpts(
	ctx context.Context,
	svc dagql.ObjectResult[*Service],
	opts ServiceStartOpts,
) (*RunningService, error)

func (*Services) StartWithIO added in v0.19.0

func (ss *Services) StartWithIO(
	ctx context.Context,
	dig digest.Digest,
	svc Startable,
	clientSpecific bool,
	sio *ServiceIO,
) (*RunningService, error)

func (*Services) StartWithOpts added in v0.21.0

func (ss *Services) StartWithOpts(
	ctx context.Context,
	dig digest.Digest,
	svc Startable,
	opts ServiceStartOpts,
) (*RunningService, error)

func (*Services) Stop added in v0.8.5

func (ss *Services) Stop(ctx context.Context, dig digest.Digest, kill bool, clientSpecific bool) error

Stop stops the given service. If the service is not running, it is a no-op.

func (*Services) StopRunning added in v0.21.0

func (ss *Services) StopRunning(ctx context.Context, running *RunningService, force bool) error

func (*Services) StopSessionServices added in v0.12.0

func (ss *Services) StopSessionServices(ctx context.Context, sessionID string) error

StopSessionServices stops all of the services being run by the given server. It is called when a server is closing.

type Socket added in v0.3.7

type Socket struct {
	Kind           SocketKind
	Handle         dagql.SessionResourceHandle
	URLVal         string
	PortForwardVal PortForward
	SourceClientID string
}

func ResolveSessionSocket added in v0.21.0

func ResolveSessionSocket(ctx context.Context, socket *Socket) (*Socket, error)

func (*Socket) AgentFingerprints added in v0.21.0

func (socket *Socket) AgentFingerprints(ctx context.Context) ([]string, error)

func (*Socket) DecodePersistedObject added in v0.21.0

func (*Socket) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, call *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*Socket) EncodePersistedObject added in v0.21.0

func (socket *Socket) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Socket) ForwardAgentClient added in v0.21.0

func (socket *Socket) ForwardAgentClient(ctx context.Context) (sshforward.SSH_ForwardAgentClient, error)

func (*Socket) MountSSHAgent added in v0.21.0

func (socket *Socket) MountSSHAgent(ctx context.Context) (string, func() error, error)

func (*Socket) PortForward added in v0.21.0

func (socket *Socket) PortForward(ctx context.Context) (PortForward, error)

func (*Socket) Type added in v0.9.7

func (*Socket) Type() *ast.Type

func (*Socket) TypeDescription added in v0.9.7

func (*Socket) TypeDescription() string

func (*Socket) URL added in v0.21.0

func (socket *Socket) URL(ctx context.Context) (string, error)

type SocketID added in v0.3.7

type SocketID = dagql.ID[*Socket]

type SocketKind added in v0.21.0

type SocketKind string
const (
	SocketKindSSHHandle  SocketKind = "ssh_handle"
	SocketKindUnixOpaque SocketKind = "unix_opaque"
	SocketKindHostIP     SocketKind = "host_ip"
)

type SourceMap added in v0.13.7

type SourceMap struct {
	Module   string `field:"true" doc:"The module dependency this was declared in."`
	Filename string `field:"true" doc:"The filename from the module source."`
	Line     int    `field:"true" doc:"The line number within the filename."`
	Column   int    `field:"true" doc:"The column number within the line."`
	URL      string `field:"true" doc:"The URL to the file, if any. This can be used to link to the source map in the browser."`
}

func (SourceMap) Clone added in v0.13.7

func (sourceMap SourceMap) Clone() *SourceMap

func (*SourceMap) DecodePersistedObject added in v0.21.0

func (*SourceMap) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*SourceMap) EncodePersistedObject added in v0.21.0

func (sourceMap *SourceMap) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*SourceMap) Type added in v0.13.7

func (*SourceMap) Type() *ast.Type

func (*SourceMap) TypeDescription added in v0.13.7

func (*SourceMap) TypeDescription() string

func (*SourceMap) TypeDirective added in v0.13.7

func (sourceMap *SourceMap) TypeDirective() *ast.Directive

type SourceMapID added in v0.13.7

type SourceMapID = dagql.ID[*SourceMap]

type SpecificClientAttachableConnOpts added in v0.21.0

type SpecificClientAttachableConnOpts struct {
	// IfAvailable returns ok=false instead of waiting when the client currently
	// has no active session attachables.
	IfAvailable bool
}

type Startable added in v0.8.5

type Startable interface {
	Start(
		ctx context.Context,
		running *RunningService,
		digest digest.Digest,
		opts ServiceStartOpts,
	) error
}

type Stat added in v0.19.9

type Stat struct {
	Size        int      `field:"true" doc:"file size"`
	Name        string   `field:"true" doc:"file name"`
	FileType    FileType `field:"true" doc:"file type"`
	Permissions int      `field:"true" doc:"permission bits"`
}

func CallDirStat added in v0.19.10

func CallDirStat(ctx context.Context, dir dagql.ObjectResult[*Directory], path string) (string, *Stat, error)

func (Stat) Clone added in v0.19.9

func (s Stat) Clone() *Stat

func (*Stat) IsDir added in v0.19.10

func (s *Stat) IsDir() bool

func (*Stat) Type added in v0.19.9

func (*Stat) Type() *ast.Type

func (*Stat) TypeDescription added in v0.19.9

func (*Stat) TypeDescription() string

type StatFS added in v0.18.7

type StatFS interface {
	Stat(ctx context.Context, path string) (string, *Stat, error)
}

type StatFSFunc added in v0.18.7

type StatFSFunc func(ctx context.Context, path string) (string, *Stat, error)

func (StatFSFunc) Stat added in v0.18.7

func (f StatFSFunc) Stat(ctx context.Context, path string) (string, *Stat, error)

type Syncable added in v0.21.0

type Syncable interface {
	dagql.Typed
	Sync(context.Context) error
}

type TerminalArgs added in v0.10.1

type TerminalArgs struct {
	ExecTerminalArgs

	// Provide dagger access to the executed command
	ExperimentalPrivilegedNesting dagql.Optional[dagql.Boolean] `default:"false"`

	// Grant the process all root capabilities
	InsecureRootCapabilities dagql.Optional[dagql.Boolean] `default:"false"`
}

type TerminalLegacy added in v0.18.0

type TerminalLegacy struct{}

func (*TerminalLegacy) Evaluate added in v0.18.0

func (*TerminalLegacy) Evaluate(ctx context.Context) error

func (*TerminalLegacy) Sync added in v0.21.0

func (terminal *TerminalLegacy) Sync(ctx context.Context) error

func (*TerminalLegacy) Type added in v0.18.0

func (*TerminalLegacy) Type() *ast.Type

func (*TerminalLegacy) TypeDescription added in v0.18.0

func (*TerminalLegacy) TypeDescription() string

type TmpfsMountSource added in v0.18.18

type TmpfsMountSource struct {
	// Configure the size of the mounted tmpfs in bytes.
	Size int
}

type TypeDef added in v0.8.8

type TypeDef struct {
	Name        string      `field:"true" doc:"The canonical non-optional name of the type." doNotCache:"simple field selection"`
	Kind        TypeDefKind `field:"true" doc:"The kind of type this is (e.g. primitive, list, object)." doNotCache:"simple field selection"`
	Optional    bool        `field:"true" doc:"Whether this type can be set to null. Defaults to false." doNotCache:"simple field selection"`
	AsList      dagql.Nullable[dagql.ObjectResult[*ListTypeDef]]
	AsObject    dagql.Nullable[dagql.ObjectResult[*ObjectTypeDef]]
	AsInterface dagql.Nullable[dagql.ObjectResult[*InterfaceTypeDef]]
	AsInput     dagql.Nullable[dagql.ObjectResult[*InputTypeDef]]
	AsScalar    dagql.Nullable[dagql.ObjectResult[*ScalarTypeDef]]
	AsEnum      dagql.Nullable[dagql.ObjectResult[*EnumTypeDef]]
}

func (*TypeDef) AttachDependencyResults added in v0.21.0

func (typeDef *TypeDef) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (TypeDef) Clone added in v0.8.8

func (typeDef TypeDef) Clone() *TypeDef

func (*TypeDef) DecodePersistedObject added in v0.21.0

func (*TypeDef) DecodePersistedObject(ctx context.Context, dag *dagql.Server, _ uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error)

func (*TypeDef) EncodePersistedObject added in v0.21.0

func (typeDef *TypeDef) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*TypeDef) IsSubtypeOf added in v0.9.6

func (typeDef *TypeDef) IsSubtypeOf(otherDef *TypeDef) bool

func (*TypeDef) ToInput added in v0.9.7

func (typeDef *TypeDef) ToInput() dagql.Input

func (*TypeDef) ToType added in v0.9.7

func (typeDef *TypeDef) ToType() *ast.Type

func (*TypeDef) ToTyped added in v0.9.7

func (typeDef *TypeDef) ToTyped() dagql.Typed

func (*TypeDef) Type added in v0.9.7

func (*TypeDef) Type() *ast.Type

func (*TypeDef) TypeDescription added in v0.9.7

func (*TypeDef) TypeDescription() string

func (*TypeDef) Underlying added in v0.9.4

func (typeDef *TypeDef) Underlying() *TypeDef

func (*TypeDef) WithEnum added in v0.12.0

func (typeDef *TypeDef) WithEnum(enum dagql.ObjectResult[*EnumTypeDef]) *TypeDef

func (*TypeDef) WithEnumTypeDef added in v0.21.0

func (typeDef *TypeDef) WithEnumTypeDef(enum dagql.ObjectResult[*EnumTypeDef]) *TypeDef

func (*TypeDef) WithInputTypeDef added in v0.21.0

func (typeDef *TypeDef) WithInputTypeDef(input dagql.ObjectResult[*InputTypeDef]) *TypeDef

func (*TypeDef) WithInterface added in v0.9.6

func (typeDef *TypeDef) WithInterface(iface dagql.ObjectResult[*InterfaceTypeDef]) *TypeDef

func (*TypeDef) WithInterfaceTypeDef added in v0.21.0

func (typeDef *TypeDef) WithInterfaceTypeDef(iface dagql.ObjectResult[*InterfaceTypeDef]) *TypeDef

func (*TypeDef) WithKind added in v0.8.8

func (typeDef *TypeDef) WithKind(kind TypeDefKind) *TypeDef

func (*TypeDef) WithListOf added in v0.8.8

func (typeDef *TypeDef) WithListOf(list dagql.ObjectResult[*ListTypeDef]) *TypeDef

func (*TypeDef) WithListTypeDef added in v0.21.0

func (typeDef *TypeDef) WithListTypeDef(list dagql.ObjectResult[*ListTypeDef]) *TypeDef

func (*TypeDef) WithObject added in v0.8.8

func (typeDef *TypeDef) WithObject(obj dagql.ObjectResult[*ObjectTypeDef]) *TypeDef

func (*TypeDef) WithObjectTypeDef added in v0.21.0

func (typeDef *TypeDef) WithObjectTypeDef(obj dagql.ObjectResult[*ObjectTypeDef]) *TypeDef

func (*TypeDef) WithOptional added in v0.8.8

func (typeDef *TypeDef) WithOptional(optional bool) *TypeDef

func (*TypeDef) WithScalar added in v0.11.3

func (typeDef *TypeDef) WithScalar(scalar dagql.ObjectResult[*ScalarTypeDef]) *TypeDef

func (*TypeDef) WithScalarTypeDef added in v0.21.0

func (typeDef *TypeDef) WithScalarTypeDef(scalar dagql.ObjectResult[*ScalarTypeDef]) *TypeDef

type TypeDefID added in v0.8.8

type TypeDefID = dagql.ID[*TypeDef]

type TypeDefKind added in v0.8.8

type TypeDefKind string

func (TypeDefKind) Decoder added in v0.9.7

func (k TypeDefKind) Decoder() dagql.InputDecoder

func (TypeDefKind) String added in v0.8.8

func (k TypeDefKind) String() string

func (TypeDefKind) ToLiteral added in v0.9.7

func (k TypeDefKind) ToLiteral() call.Literal

func (TypeDefKind) Type added in v0.9.7

func (k TypeDefKind) Type() *ast.Type

func (TypeDefKind) TypeDescription added in v0.9.7

func (k TypeDefKind) TypeDescription() string

type Up added in v0.20.4

type Up struct {
	Node         *ModTreeNode  `json:"node"`
	PortMappings []PortForward `json:"portMappings,omitempty"`
}

Up represents a service function decorated with +up

func (*Up) Clone added in v0.20.4

func (u *Up) Clone() *Up

func (*Up) Description added in v0.20.4

func (u *Up) Description() string

func (*Up) Name added in v0.20.4

func (u *Up) Name() string

func (*Up) OriginalModule added in v0.20.4

func (u *Up) OriginalModule() *Module

func (*Up) Path added in v0.20.4

func (u *Up) Path() []string

func (*Up) Run added in v0.20.4

func (u *Up) Run(ctx context.Context) (*Up, error)

Run starts the service returned by this up function and blocks until ctx is cancelled.

func (*Up) Type added in v0.20.4

func (*Up) Type() *ast.Type

type UpGroup added in v0.20.4

type UpGroup struct {
	Node *ModTreeNode `json:"node"`
	Ups  []*Up        `json:"ups"`
}

func NewUpGroup added in v0.20.4

func NewUpGroup(ctx context.Context, mod dagql.ObjectResult[*Module], include []string) (*UpGroup, error)

func (*UpGroup) Clone added in v0.20.4

func (ug *UpGroup) Clone() *UpGroup

func (*UpGroup) List added in v0.20.4

func (ug *UpGroup) List() []*Up

func (*UpGroup) Run added in v0.20.4

func (ug *UpGroup) Run(ctx context.Context) (*UpGroup, error)

Run starts all service functions in the group. Before starting, it evaluates all services to detect port collisions.

Uses a two-phase approach: phase 1 starts all services in parallel and returns immediately once each is healthy; phase 2 blocks on ctx.Done(). This ensures that if one service fails to start, the error is surfaced immediately without leaving sibling goroutines hanging forever.

func (*UpGroup) Type added in v0.20.4

func (*UpGroup) Type() *ast.Type

type UserDefault added in v0.19.1

type UserDefault struct {
	UserDefaultPrimitive
}

func (*UserDefault) CallInput added in v0.20.4

func (ud *UserDefault) CallInput(ctx context.Context) (*FunctionCallArgValue, error)

func (*UserDefault) DagqlID added in v0.19.1

func (ud *UserDefault) DagqlID(ctx context.Context) (dagql.Input, error)

func (*UserDefault) DisplayInput added in v0.21.0

func (ud *UserDefault) DisplayInput() string

func (*UserDefault) IsList added in v0.20.4

func (ud *UserDefault) IsList() bool

func (*UserDefault) IsObject added in v0.19.1

func (ud *UserDefault) IsObject() bool

func (*UserDefault) IsPlaintextSecret added in v0.21.0

func (ud *UserDefault) IsPlaintextSecret() bool

func (*UserDefault) String added in v0.19.1

func (ud *UserDefault) String() string

func (*UserDefault) Value added in v0.19.1

func (ud *UserDefault) Value(ctx context.Context) (any, error)

type UserDefaultPrimitive added in v0.19.1

type UserDefaultPrimitive struct {
	Function  *ModuleFunction
	Arg       *FunctionArg
	UserInput string
}

A user-defined default value that is a primitive type (not an object) Unlike default objects, it can be safely manipulated without making nested dagql query

func (*UserDefaultPrimitive) CallInput added in v0.19.1

func (udp *UserDefaultPrimitive) CallInput() (*FunctionCallArgValue, error)

func (*UserDefaultPrimitive) DagqlInput added in v0.19.1

func (udp *UserDefaultPrimitive) DagqlInput() (dagql.Input, error)

func (*UserDefaultPrimitive) JSONValue added in v0.19.1

func (udp *UserDefaultPrimitive) JSONValue() (JSON, error)

func (*UserDefaultPrimitive) Value added in v0.19.1

func (udp *UserDefaultPrimitive) Value() (any, error)

type UserModFunctionArg added in v0.9.7

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

type Void added in v0.9.7

type Void struct{}

func (Void) DecodeInput added in v0.9.7

func (Void) DecodeInput(val any) (dagql.Input, error)

func (Void) Decoder added in v0.9.7

func (p Void) Decoder() dagql.InputDecoder

func (Void) ToLiteral added in v0.9.7

func (p Void) ToLiteral() call.Literal

func (Void) Type added in v0.9.7

func (p Void) Type() *ast.Type

func (Void) TypeDescription added in v0.9.7

func (p Void) TypeDescription() string

func (Void) TypeName added in v0.9.7

func (p Void) TypeName() string

type WalkFunc added in v0.19.11

type WalkFunc func(context.Context, *ModTreeNode) (bool, error)

type WithChangesetMergeConflict added in v0.19.11

type WithChangesetMergeConflict int
const (
	// FailEarlyOnConflict fails before attempting merge if file-level conflicts are detected.
	FailEarlyOnConflict WithChangesetMergeConflict = iota
	// FailOnConflict attempts the merge and fails if git merge fails due to conflicts.
	FailOnConflict
	// LeaveConflictMarkers lets git create conflict markers in files. For modify/delete
	// conflicts, keeps the modified version. Fails on binary conflicts.
	LeaveConflictMarkers
	// PreferOursOnConflict uses -X ours strategy and resolves modify/delete by preferring ours.
	PreferOursOnConflict
	// PreferTheirsOnConflict uses -X theirs strategy and resolves modify/delete by preferring theirs.
	PreferTheirsOnConflict
)

type WithChangesetsMergeConflict added in v0.19.11

type WithChangesetsMergeConflict int

WithChangesetsMergeConflict specifies how to handle conflicts when merging multiple changesets using git's octopus merge strategy. Only FAIL_EARLY and FAIL are supported (no -X ours/theirs).

const (
	// FailEarlyOnConflicts fails before attempting merge if file-level conflicts are detected.
	FailEarlyOnConflicts WithChangesetsMergeConflict = iota
	// FailOnConflicts attempts the merge and fails if git merge fails due to conflicts.
	FailOnConflicts
)

type Workspace added in v0.20.0

type Workspace struct {

	// Path is the workspace directory relative to the workspace boundary.
	Path        string `field:"true" doc:"Workspace directory path relative to the workspace boundary."`
	Address     string `field:"true" doc:"Canonical Dagger address of the workspace directory."`
	Initialized bool   `field:"true" doc:"Whether .dagger/config.toml exists."`
	ConfigPath  string `field:"true" doc:"Path to config.toml relative to the workspace boundary (empty if not initialized)."`
	HasConfig   bool   `field:"true" doc:"Whether a config.toml file exists in the workspace."`

	// ClientID is the ID of the client that created this workspace.
	// Used to route host filesystem operations through the correct session
	// when the workspace is passed to a module function.
	ClientID string `field:"true" doc:"The client ID that owns this workspace's host filesystem."`
	// contains filtered or unexported fields
}

Workspace represents a detected workspace in the dagql schema.

func (*Workspace) AttachDependencyResults added in v0.21.0

func (ws *Workspace) AttachDependencyResults(
	ctx context.Context,
	_ dagql.AnyResult,
	attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error)

func (*Workspace) Clone added in v0.20.0

func (ws *Workspace) Clone() *Workspace

func (*Workspace) DecodePersistedObject added in v0.21.0

func (*Workspace) DecodePersistedObject(
	ctx context.Context,
	dag *dagql.Server,
	_ uint64,
	_ *dagql.ResultCall,
	payload json.RawMessage,
) (dagql.Typed, error)

func (*Workspace) EncodePersistedObject added in v0.21.0

func (ws *Workspace) EncodePersistedObject(ctx context.Context, cache dagql.PersistedObjectCache) (dagql.PersistedObjectEncoding, error)

func (*Workspace) HostPath added in v0.20.4

func (ws *Workspace) HostPath() string

HostPath returns the internal host filesystem path for the workspace boundary. Returns empty string for remote workspaces (read-only).

func (*Workspace) Rootfs added in v0.20.4

func (ws *Workspace) Rootfs() dagql.ObjectResult[*Directory]

Rootfs returns the pre-fetched root filesystem directory for remote workspaces. Returns a zero value for local workspaces (they resolve lazily).

func (*Workspace) SetHostPath added in v0.20.4

func (ws *Workspace) SetHostPath(p string)

SetHostPath sets the internal host filesystem path.

func (*Workspace) SetRootfs added in v0.20.4

func (ws *Workspace) SetRootfs(r dagql.ObjectResult[*Directory])

SetRootfs sets the pre-fetched root filesystem (used by remote workspace setup).

func (*Workspace) Type added in v0.20.0

func (*Workspace) Type() *ast.Type

func (*Workspace) TypeDescription added in v0.20.0

func (*Workspace) TypeDescription() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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