sdkmodule

package
v1.0.0-beta.12 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package sdkmodule loads and calls modules that implement the SDK-module authoring interface.

This package is intentionally separate from core/sdk. The latter loads the runtime and code-generation implementation named by dagger-module.toml. An SDK module is a normal installed workspace module that edits a Workspace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Implements

func Implements(mod *core.Module) bool

Implements reports whether mod implements the complete SDK-module interface. It performs schema validation only. Load performs the same validation and also constructs the provider instance.

Types

type Provider

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

Provider is one loaded SDK module.

func Load

func Load(
	ctx context.Context,
	root *core.Query,
	ref string,
	parentSrc *core.ModuleSource,
	settings map[string]any,
) (*Provider, error)

Load resolves ref as a normal module and validates the SDK-module interface. parentSrc supplies the workspace filesystem context for local provider refs.

func (*Provider) DefaultModulePath

func (provider *Provider) DefaultModulePath(
	ctx context.Context,
	ws dagql.ObjectResult[*core.Workspace],
	name string,
) (string, error)

DefaultModulePath asks the provider where a new module named name belongs. An empty result means the engine picks the path. Callers must skip this when the user passed an explicit path.

func (*Provider) FindClientRoot

func (provider *Provider) FindClientRoot(
	ctx context.Context,
	ws dagql.ObjectResult[*core.Workspace],
) (string, error)

FindClientRoot finds the SDK client root that contains ws.Cwd. A null result means this provider found no usable root.

func (*Provider) GenerateScope

func (provider *Provider) GenerateScope(
	ctx context.Context,
	ws dagql.ObjectResult[*core.Workspace],
	isModule bool,
	name string,
	clients []dagql.ObjectResult[*core.ModuleSource],
) (dagql.ObjectResult[*core.Workspace], error)

GenerateScope reconciles all SDK-managed state for ws.Cwd.

func (*Provider) ImplementsDefaultModulePath

func (provider *Provider) ImplementsDefaultModulePath() bool

ImplementsDefaultModulePath reports whether this provider implements the optional defaultModulePath function.

func (*Provider) Module

func (provider *Provider) Module() dagql.ObjectResult[*core.Module]

Module returns the loaded provider module result.

Jump to

Keyboard shortcuts

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