Documentation
¶
Overview ¶
Package sdkmeta holds metadata about the SDK runtimes bundled in the engine. It carries no dependencies so both core/sdk and core/workspace can share the canonical builtin SDK list without an import cycle.
Index ¶
Constants ¶
const ( Go = "go" Dang = "dang" Python = "python" Typescript = "typescript" PHP = "php" Elixir = "elixir" Java = "java" )
Builtin SDK runtime short names bundled in the engine.
const InstallNamePrefix = "dagger-"
InstallNamePrefix is prepended to the workspace install name of a known SDK (e.g. "go" -> "dagger-go-sdk") to reduce the chance of colliding with an unrelated module. The SDK's source ref and command name are unaffected.
Variables ¶
var Builtins = []string{Go, Dang, Python, Typescript, PHP, Elixir, Java}
Builtins lists every SDK runtime short name bundled in the engine.
Functions ¶
func IsBuiltin ¶
IsBuiltin reports whether name (without any "@version" suffix) is a builtin SDK runtime short name.
func Resolve ¶
Resolve maps a user-supplied SDK install value to the canonical full ref that should flow downstream to the engine.
Resolution rules:
- If input contains `/` or `@`, treat as a full ref. Return as-is.
- Otherwise look up in sdks.json by name first, then alias, then repo basename as a compatibility fallback (`go-sdk`).
- 0 matches → error ("not found").
- 1 match → return entry.Repo.
- N > 1 → error ("ambiguous"), with candidate names.
Registry names and aliases affect the default install name and the SDK name persisted under [sdks.<name>]. Only canonical full refs flow past this function.
func ResolveInstall ¶
ResolveInstall maps an SDK install value to:
- the canonical full ref that should flow downstream to the engine; and
- the workspace install name to use when the user did not pass --name: the registry repo basename with a "dagger-" prefix (e.g. "dagger-go-sdk"), reducing the chance of colliding with an unrelated module; and
- the registry's canonical user-facing SDK name.
Full refs return an empty install name so Workspace.withSDK keeps its normal basename-derived behavior for third-party SDK refs. They also return an empty SDK name so third-party refs can rely on the conventional name derived from the module entry name.
Types ¶
type SDKEntry ¶
type SDKEntry struct {
Name string `json:"name"` // canonical user-facing SDK name (e.g., "go")
Description string `json:"description"` // user-facing search description
Repo string `json:"repo"` // canonical full ref (e.g., "github.com/dagger/go-sdk")
Aliases []string `json:"aliases"` // user-facing shorthands (e.g., ["golang"])
}
SDKEntry identifies an SDK and its accepted short names.
func LoadRegistry ¶
LoadRegistry returns the embedded SDK registry.
func ParseRegistry ¶
ParseRegistry decodes an SDK registry.