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 ¶
- func Implements(mod *core.Module) bool
- type Provider
- func (provider *Provider) DefaultModulePath(ctx context.Context, ws dagql.ObjectResult[*core.Workspace], name string) (string, error)
- func (provider *Provider) FindClientRoot(ctx context.Context, ws dagql.ObjectResult[*core.Workspace]) (string, error)
- func (provider *Provider) GenerateScope(ctx context.Context, ws dagql.ObjectResult[*core.Workspace], isModule bool, ...) (dagql.ObjectResult[*core.Workspace], error)
- func (provider *Provider) ImplementsDefaultModulePath() bool
- func (provider *Provider) Module() dagql.ObjectResult[*core.Module]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Implements ¶
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 ¶
ImplementsDefaultModulePath reports whether this provider implements the optional defaultModulePath function.