Documentation
¶
Index ¶
- Constants
- func ComposeOverrideFile(stateDir string) string
- func ComposeProjectName(workspace string, configPath string) string
- func ContainerCommand(config Config) []string
- func EffectiveContext(config Config) string
- func EffectiveDockerfile(config Config) string
- func FeatureLockFilePath(configPath string) string
- func KeepAliveCommand() string
- func MetadataLabelValue(entries []MetadataEntry) (string, error)
- func RemoteExecUser(config Config) string
- func ResolveComposeFiles(configDir string, raw any) ([]string, error)
- func ResolveConfigPath(workspace string, configArg string) (string, error)
- func ResolveWorkspacePath(workspaceArg string) (string, error)
- func ResolvedDockerfile(configDir string, config Config) string
- func ShellQuote(value string) string
- func SortedMapKeys(values map[string]string) []string
- func StandardizeJSONC(path string, data []byte) ([]byte, error)
- func WriteFeatureLockFile(configPath string, features []ResolvedFeature) error
- func WriteFeatureStateFile(stateDir string, features []ResolvedFeature) error
- type BuildConfig
- type Config
- type FeatureLockEntry
- type FeatureLockFile
- type FeatureLockfilePolicy
- type FeatureResolveOptions
- type FeatureStateEntry
- type FeatureStateFile
- type ForwardPorts
- type LifecycleCommand
- type LifecycleStep
- type MergedConfig
- type MetadataEntry
- type MountSpec
- type ResolveOptions
- type ResolvedConfig
- func Resolve(ctx context.Context, workspaceArg string, configArg string) (ResolvedConfig, error)
- func ResolveReadOnly(ctx context.Context, workspaceArg string, configArg string) (ResolvedConfig, error)
- func ResolveReadOnlyWithOptions(ctx context.Context, workspaceArg string, configArg string, ...) (ResolvedConfig, error)
- func ResolveWithOptions(ctx context.Context, workspaceArg string, configArg string, ...) (ResolvedConfig, error)
- func ResolveWorkspaceSpecWithOptions(ctx context.Context, workspaceSpec WorkspaceSpec, stateDir string, ...) (ResolvedConfig, error)
- type ResolvedFeature
- type WorkspaceSpec
Constants ¶
View Source
const ( HostFolderLabel = "devcontainer.local_folder" ConfigFileLabel = "devcontainer.config_file" ManagedByLabel = "devcontainer.managed_by" ManagedByValue = "hatchctl" BridgeEnabledLabel = "devcontainer.bridge.enabled" SSHAgentLabel = "devcontainer.ssh_agent.enabled" )
View Source
const ImageMetadataLabel = "devcontainer.metadata"
Variables ¶
This section is empty.
Functions ¶
func ComposeOverrideFile ¶
func ComposeProjectName ¶
func ContainerCommand ¶
func EffectiveContext ¶
func EffectiveDockerfile ¶
func FeatureLockFilePath ¶
func KeepAliveCommand ¶ added in v0.1.6
func KeepAliveCommand() string
func MetadataLabelValue ¶
func MetadataLabelValue(entries []MetadataEntry) (string, error)
func RemoteExecUser ¶
func ResolveConfigPath ¶ added in v0.6.5
func ResolveWorkspacePath ¶ added in v0.6.5
func ResolvedDockerfile ¶ added in v0.8.2
func ShellQuote ¶
func SortedMapKeys ¶
func StandardizeJSONC ¶ added in v0.8.2
func WriteFeatureLockFile ¶
func WriteFeatureLockFile(configPath string, features []ResolvedFeature) error
func WriteFeatureStateFile ¶
func WriteFeatureStateFile(stateDir string, features []ResolvedFeature) error
Types ¶
type BuildConfig ¶
type Config ¶
type Config struct {
Name string `json:"name,omitempty"`
Image string `json:"image,omitempty"`
DockerFile string `json:"dockerFile,omitempty"`
WorkspaceFolder string `json:"workspaceFolder,omitempty"`
WorkspaceMount string `json:"workspaceMount,omitempty"`
Mounts []string `json:"mounts,omitempty"`
ContainerEnv map[string]string `json:"containerEnv,omitempty"`
RemoteEnv map[string]string `json:"remoteEnv,omitempty"`
ContainerUser string `json:"containerUser,omitempty"`
RemoteUser string `json:"remoteUser,omitempty"`
RunArgs []string `json:"runArgs,omitempty"`
ForwardPorts ForwardPorts `json:"forwardPorts,omitempty"`
InitializeCommand LifecycleCommand `json:"initializeCommand,omitempty"`
OnCreateCommand LifecycleCommand `json:"onCreateCommand,omitempty"`
UpdateContentCommand LifecycleCommand `json:"updateContentCommand,omitempty"`
PostCreateCommand LifecycleCommand `json:"postCreateCommand,omitempty"`
PostStartCommand LifecycleCommand `json:"postStartCommand,omitempty"`
PostAttachCommand LifecycleCommand `json:"postAttachCommand,omitempty"`
WaitFor string `json:"waitFor,omitempty"`
OverrideCommand *bool `json:"overrideCommand,omitempty"`
UpdateRemoteUserUID *bool `json:"updateRemoteUserUID,omitempty"`
Init *bool `json:"init,omitempty"`
Privileged *bool `json:"privileged,omitempty"`
CapAdd []string `json:"capAdd,omitempty"`
SecurityOpt []string `json:"securityOpt,omitempty"`
Build *BuildConfig `json:"build,omitempty"`
Customizations map[string]any `json:"customizations,omitempty"`
Features map[string]any `json:"features,omitempty"`
DockerComposeFile any `json:"dockerComposeFile,omitempty"`
Service string `json:"service,omitempty"`
Raw map[string]any `json:"-"`
}
type FeatureLockEntry ¶
type FeatureLockEntry = storefs.FeatureLockEntry
type FeatureLockFile ¶
type FeatureLockFile = storefs.FeatureLockFile
func ReadFeatureLockFile ¶
func ReadFeatureLockFile(configPath string) (FeatureLockFile, bool, error)
type FeatureLockfilePolicy ¶
type FeatureLockfilePolicy string
const ( FeatureLockfilePolicyAuto FeatureLockfilePolicy = "auto" FeatureLockfilePolicyFrozen FeatureLockfilePolicy = "frozen" FeatureLockfilePolicyUpdate FeatureLockfilePolicy = "update" )
func ParseFeatureLockfilePolicy ¶
func ParseFeatureLockfilePolicy(value string) (FeatureLockfilePolicy, error)
type FeatureResolveOptions ¶
type FeatureStateEntry ¶
type FeatureStateEntry = storefs.FeatureStateEntry
type FeatureStateFile ¶
type FeatureStateFile = storefs.FeatureStateFile
type ForwardPorts ¶
type ForwardPorts []string
func MergeForwardPorts ¶
func MergeForwardPorts(entries ...ForwardPorts) ForwardPorts
func NormalizeForwardPorts ¶
func NormalizeForwardPorts(raw []any) (ForwardPorts, error)
func (ForwardPorts) MarshalJSON ¶
func (p ForwardPorts) MarshalJSON() ([]byte, error)
func (*ForwardPorts) UnmarshalJSON ¶
func (p *ForwardPorts) UnmarshalJSON(data []byte) error
type LifecycleCommand ¶
type LifecycleCommand struct {
Kind string
Value string
Args []string
Steps map[string]LifecycleCommand
Exists bool
}
func (LifecycleCommand) Empty ¶
func (c LifecycleCommand) Empty() bool
func (LifecycleCommand) MarshalJSON ¶
func (c LifecycleCommand) MarshalJSON() ([]byte, error)
func (LifecycleCommand) SortedSteps ¶
func (c LifecycleCommand) SortedSteps() []LifecycleStep
func (*LifecycleCommand) UnmarshalJSON ¶
func (c *LifecycleCommand) UnmarshalJSON(data []byte) error
type LifecycleStep ¶
type LifecycleStep struct {
Name string
Command LifecycleCommand
}
type MergedConfig ¶
type MergedConfig struct {
Config Config
Init bool
Privileged bool
CapAdd []string
SecurityOpt []string
Mounts []string
RemoteUser string
ContainerUser string
RemoteEnv map[string]string
ContainerEnv map[string]string
OverrideCommand *bool
UpdateRemoteUserUID *bool
WaitFor string
ForwardPorts ForwardPorts
OnCreateCommands []LifecycleCommand
UpdateContentCommands []LifecycleCommand
PostCreateCommands []LifecycleCommand
PostStartCommands []LifecycleCommand
PostAttachCommands []LifecycleCommand
Customizations map[string][]any
Metadata []MetadataEntry
}
func MergeMetadata ¶
func MergeMetadata(config Config, metadata []MetadataEntry) MergedConfig
type MetadataEntry ¶
type MetadataEntry struct {
ID string `json:"id,omitempty"`
Init *bool `json:"init,omitempty"`
Privileged *bool `json:"privileged,omitempty"`
CapAdd []string `json:"capAdd,omitempty"`
SecurityOpt []string `json:"securityOpt,omitempty"`
Mounts []string `json:"mounts,omitempty"`
OnCreateCommand LifecycleCommand `json:"onCreateCommand,omitempty"`
UpdateContentCommand LifecycleCommand `json:"updateContentCommand,omitempty"`
PostCreateCommand LifecycleCommand `json:"postCreateCommand,omitempty"`
PostStartCommand LifecycleCommand `json:"postStartCommand,omitempty"`
PostAttachCommand LifecycleCommand `json:"postAttachCommand,omitempty"`
WaitFor string `json:"waitFor,omitempty"`
RemoteUser string `json:"remoteUser,omitempty"`
ContainerUser string `json:"containerUser,omitempty"`
RemoteEnv map[string]string `json:"remoteEnv,omitempty"`
ContainerEnv map[string]string `json:"containerEnv,omitempty"`
OverrideCommand *bool `json:"overrideCommand,omitempty"`
UpdateRemoteUserUID *bool `json:"updateRemoteUserUID,omitempty"`
ForwardPorts ForwardPorts `json:"forwardPorts,omitempty"`
Customizations map[string]any `json:"customizations,omitempty"`
}
func ConfigMetadata ¶
func ConfigMetadata(config Config) MetadataEntry
func FeaturesMetadata ¶ added in v0.8.1
func FeaturesMetadata(features []ResolvedFeature) []MetadataEntry
func MetadataFromLabel ¶
func MetadataFromLabel(value string) ([]MetadataEntry, error)
func (MetadataEntry) MarshalJSON ¶
func (m MetadataEntry) MarshalJSON() ([]byte, error)
type MountSpec ¶ added in v0.1.5
type MountSpec struct {
Type string
Source string
Target string
ReadOnly bool
Consistency string
BindPropagation string
CreateHostPath *bool
SELinux string
NoCopy bool
Subpath string
Raw string
}
func ParseMountSpec ¶ added in v0.1.5
type ResolveOptions ¶
type ResolveOptions struct {
AllowNetwork bool
ReadPlanCache bool
WritePlanCache bool
WriteFeatureLock bool
WriteFeatureState bool
Warn func(string)
StateBaseDir string
CacheBaseDir string
VerifyImage func(context.Context, string) security.VerificationResult
FeatureHTTPTimeout time.Duration
LockfilePolicy FeatureLockfilePolicy
}
type ResolvedConfig ¶
type ResolvedConfig struct {
WorkspaceFolder string
ConfigPath string
ConfigDir string
Config Config
Features []ResolvedFeature
Merged MergedConfig
StateDir string
CacheDir string
WorkspaceMount string
RemoteWorkspace string
ImageName string
SourceKind string
ContainerName string
ComposeFiles []string
ComposeService string
ComposeProject string
Labels map[string]string
}
func ResolveReadOnly ¶
func ResolveReadOnlyWithOptions ¶
func ResolveReadOnlyWithOptions(ctx context.Context, workspaceArg string, configArg string, opts ResolveOptions) (ResolvedConfig, error)
func ResolveWithOptions ¶
func ResolveWithOptions(ctx context.Context, workspaceArg string, configArg string, opts ResolveOptions) (ResolvedConfig, error)
func ResolveWorkspaceSpecWithOptions ¶ added in v0.6.15
func ResolveWorkspaceSpecWithOptions(ctx context.Context, workspaceSpec WorkspaceSpec, stateDir string, cacheDir string, opts ResolveOptions) (ResolvedConfig, error)
type ResolvedFeature ¶
type ResolvedFeature struct {
SourceKind string
Source string
Path string
Version string
Resolved string
Integrity string
Verification security.VerificationResult
Options map[string]string
DependsOn []string
InstallsAfter []string
Metadata MetadataEntry
}
func ResolveFeatures ¶
func ResolveFeatures(ctx context.Context, configPath string, configDir string, cacheDir string, values map[string]any, opts FeatureResolveOptions) ([]ResolvedFeature, error)
type WorkspaceSpec ¶ added in v0.6.5
type WorkspaceSpec struct {
WorkspaceFolder string
ConfigPath string
ConfigDir string
Config Config
Merged MergedConfig
WorkspaceMount string
RemoteWorkspace string
SourceKind string
ComposeFiles []string
ComposeService string
}
func ResolveWorkspaceSpec ¶ added in v0.8.2
func ResolveWorkspaceSpec(workspaceArg string, configArg string) (WorkspaceSpec, error)
Click to show internal directories.
Click to hide internal directories.