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
- func DeclaresEntrypointSources(dir string) (bool, error)
- func EntrypointModuleTypes(ctx context.Context, deps *core.SchemaBuilder, ...) (inst dagql.ObjectResult[*core.Module], rerr error)
- func EntrypointSources(ctx context.Context, src *core.ModuleSource, ...) (dagql.ObjectResult[*core.Directory], error)
- func NewEntrypointRuntime(deps *core.SchemaBuilder, source dagql.ObjectResult[*core.ModuleSource]) core.ModuleRuntime
- type Impl
Constants ¶
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 ¶
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 ¶
func (Impl) Runtime( ctx context.Context, deps *core.SchemaBuilder, source dagql.ObjectResult[*core.ModuleSource], ) (core.ModuleRuntime, error)