sdkmeta

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: 6 Imported by: 0

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

View Source
const (
	Go         = "go"
	Dang       = "dang"
	Python     = "python"
	Typescript = "typescript"
	PHP        = "php"
	Elixir     = "elixir"
	Java       = "java"
)

Builtin SDK runtime short names bundled in the engine.

View Source
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

Builtins lists every SDK runtime short name bundled in the engine.

Functions

func IsBuiltin

func IsBuiltin(name string) bool

IsBuiltin reports whether name (without any "@version" suffix) is a builtin SDK runtime short name.

func Resolve

func Resolve(input string) (string, error)

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

func ResolveInstall(input string) (ref string, installName string, sdkName string, _ error)

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

func LoadRegistry() ([]SDKEntry, error)

LoadRegistry returns the embedded SDK registry.

func ParseRegistry

func ParseRegistry(data []byte) ([]SDKEntry, error)

ParseRegistry decodes an SDK registry.

Jump to

Keyboard shortcuts

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