Documentation
¶
Index ¶
- Constants
- func FetchOCIManifest(ref name.Reference) (*v1.Manifest, error)
- func GetFeatureEnvVariables(feature *config.FeatureConfig, featureOptions any) []string
- func GetFeatureInstallWrapperScript(idWithoutVersion string, feature *config.FeatureConfig, options []string) string
- func IsSecretOption(option config.FeatureConfigOption) bool
- func LoadOCIAnnotations(featureFolder string) map[string]string
- func ProcessFeatureID(id string, devContainerConfig *config.DevContainerConfig, forceBuild bool) (string, error)
- func PullFeatureToTemp(ref name.Reference, id string) (string, error)
- func ResolveFeatureOrder(devContainerConfig *config.DevContainerConfig) ([]*config.FeatureSet, error)
- func ResolveSecretOptions(featureID string, featureCfg *config.FeatureConfig, userOptions map[string]any, ...) (map[string]any, error)
- func ValidateFeatureOptions(featureID string, featureCfg *config.FeatureConfig, userOptions any) error
- type BuildInfo
- type Collection
- type CollectionFeature
- type ExtendedBuildInfo
- type ExtendedBuildParams
- type SecretOptions
- type SecretPrompter
- type TerminalSecretPrompter
Constants ¶
const CollectionLayerMediaType = "application/vnd.devcontainers.collection.layer.v1+json"
const DEVCONTAINER_MANIFEST_MEDIATYPE = "application/vnd.devcontainers"
const FEATURE_BASE_DOCKERFILE = ` FROM $_DEV_CONTAINERS_BASE_IMAGE AS dev_containers_target_stage USER root COPY ./` + config.DevsyContextFeatureFolder + `/ /tmp/build-features/ RUN chmod -R 0755 /tmp/build-features && ls /tmp/build-features #{featureLayer} ARG _DEV_CONTAINERS_IMAGE_USER=root USER $_DEV_CONTAINERS_IMAGE_USER `
Variables ¶
This section is empty.
Functions ¶
func FetchOCIManifest ¶ added in v1.1.0
func GetFeatureEnvVariables ¶ added in v1.1.0
func GetFeatureEnvVariables(feature *config.FeatureConfig, featureOptions any) []string
func GetFeatureInstallWrapperScript ¶ added in v1.1.0
func GetFeatureInstallWrapperScript( idWithoutVersion string, feature *config.FeatureConfig, options []string, ) string
func IsSecretOption ¶ added in v1.1.0
func IsSecretOption(option config.FeatureConfigOption) bool
IsSecretOption returns true if the given option has type "secret".
func LoadOCIAnnotations ¶ added in v1.1.0
func ProcessFeatureID ¶
func PullFeatureToTemp ¶ added in v1.1.0
func ResolveFeatureOrder ¶ added in v1.1.0
func ResolveFeatureOrder( devContainerConfig *config.DevContainerConfig, ) ([]*config.FeatureSet, error)
ResolveFeatureOrder parses the features in a DevContainerConfig, resolves their dependencies, and returns them in topological install order.
func ResolveSecretOptions ¶ added in v1.1.0
func ResolveSecretOptions( featureID string, featureCfg *config.FeatureConfig, userOptions map[string]any, opts *SecretOptions, ) (map[string]any, error)
ResolveSecretOptions resolves secret-typed options for a feature. For each option with type "secret", it checks (in order): user-provided value, environment variable, secrets file, default value. Returns an error if a secret is required but not provided.
func ValidateFeatureOptions ¶ added in v1.1.0
func ValidateFeatureOptions( featureID string, featureCfg *config.FeatureConfig, userOptions any, ) error
ValidateFeatureOptions checks that user-provided option values satisfy the type and enum constraints declared in the feature configuration.
Types ¶
type Collection ¶ added in v1.1.0
type Collection struct {
Features []CollectionFeature `json:"features"`
}
func FetchCollection ¶ added in v1.1.0
func FetchCollection(registry, namespace string) (*Collection, error)
type CollectionFeature ¶ added in v1.1.0
type CollectionFeature struct {
ID string `json:"id"`
Version string `json:"version"`
Name string `json:"name"`
Description string `json:"description"`
DocumentationURL string `json:"documentationURL,omitempty"`
Options map[string]any `json:"options,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
}
func ListCollectionFeatures ¶ added in v1.1.0
func ListCollectionFeatures(registry, namespace string) ([]CollectionFeature, error)
type ExtendedBuildInfo ¶
type ExtendedBuildInfo struct {
Features []*config.FeatureSet
FeaturesBuildInfo *BuildInfo
MetadataConfig *config.ImageMetadataConfig
MetadataLabel string
}
func GetExtendedBuildInfo ¶
func GetExtendedBuildInfo(params *ExtendedBuildParams) (*ExtendedBuildInfo, error)
type ExtendedBuildParams ¶ added in v1.1.0
type ExtendedBuildParams struct {
Ctx *config.SubstitutionContext
ImageBuildInfo *config.ImageBuildInfo
Target string
DevContainerConfig *config.SubstitutedConfig
ForceBuild bool
SecretOpts *SecretOptions
}
type SecretOptions ¶ added in v1.1.0
type SecretOptions struct {
SecretsFile string
Prompter SecretPrompter
}
SecretOptions holds configuration for resolving secret-typed feature options.
type SecretPrompter ¶ added in v1.1.0
SecretPrompter prompts the user for a secret value. Implementations should mask input when running interactively, or handle non-interactive mode (e.g. emit a warning and return an empty string).
type TerminalSecretPrompter ¶ added in v1.1.0
type TerminalSecretPrompter struct {
IsTerminal func() bool
}
TerminalSecretPrompter prompts for secrets interactively when stdin is a terminal, and emits a warning in non-interactive mode.
func (*TerminalSecretPrompter) PromptSecret ¶ added in v1.1.0
func (p *TerminalSecretPrompter) PromptSecret(featureID, optionName string) (string, error)