dangv2

package
v1.0.0-beta.21 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package dangv2 evaluates Dagger modules written against Dang v2 (github.com/vito/dang/v2: `.{ }` is dot-block application, `.{{ }}` is selection).

This is the LIVING implementation: new Dang SDK features land here only. Older majors are frozen snapshots of this package; see core/sdk/dang/README.md for the maintenance policy.

Index

Constants

View Source
const EntrypointSourcesMember = "sources"

EntrypointSourcesMember is the optional entrypoint member that returns the files the module builds from. Declaring it selects the entrypoint contract in which types and call receive no workspace.

Variables

This section is empty.

Functions

func DeclaresEntrypointSources

func DeclaresEntrypointSources(dir string) (bool, error)

DeclaresEntrypointSources reports whether a type that implements ModuleEntrypoint in the top-level Dang files of dir declares a public sources member. A comment, a string, a private member or a member of another type does not count. A file that does not parse declares nothing, so its error surfaces when the entrypoint runs.

func EntrypointModuleTypes

func EntrypointModuleTypes(
	ctx context.Context,
	deps *core.SchemaBuilder,
	src dagql.ObjectResult[*core.ModuleSource],
	moduleContext dagql.ObjectResult[*core.Module],
) (inst dagql.ObjectResult[*core.Module], rerr error)

EntrypointModuleTypes calls types on a built-in Dang module entrypoint.

func EntrypointSources

func EntrypointSources(
	ctx context.Context,
	src *core.ModuleSource,
	entryDir dagql.ObjectResult[*core.Directory],
	schemaFile dagql.Result[*core.File],
	workspace dagql.ObjectResult[*core.Workspace],
) (dagql.ObjectResult[*core.Directory], error)

EntrypointSources calls the sources member of the entrypoint in entryDir with workspace and returns the Directory it returns. No module exists yet, so the program runs without currentModule. Its nested client has what a module function has: the Dagger API, and the host only through the workspace it is given.

func NewEntrypointRuntime

func NewEntrypointRuntime(
	deps *core.SchemaBuilder,
	source dagql.ObjectResult[*core.ModuleSource],
) core.ModuleRuntime

NewEntrypointRuntime returns the built-in Dang module entrypoint runtime.

Types

type Impl

type Impl struct{}

Impl is the Dang v2 implementation behind the dang SDK's version dispatch.

func (Impl) ModuleTypes

func (Impl) ModuleTypes(
	ctx context.Context,
	deps *core.SchemaBuilder,
	src dagql.ObjectResult[*core.ModuleSource],
	scopedMod dagql.ObjectResult[*core.Module],
) (inst dagql.ObjectResult[*core.Module], rerr error)

func (Impl) Runtime

Jump to

Keyboard shortcuts

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