devcontainer

package
v0.0.0-...-5be3747 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright © 2022 Shane Moore shane@shanemoore.me

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2022 Shane Moore shane@shanemoore.me

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2022 Shane Moore shane@shanemoore.me

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2022 Shane Moore shane@shanemoore.me

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppPort

type AppPort []string

func (*AppPort) UnmarshalJSON

func (appPort *AppPort) UnmarshalJSON(bytes []byte) error

type Build

type Build struct {
	Dockerfile string             `json:"dockerfile"`
	Context    string             `json:"context"`
	Args       map[string]*string `json:"args"`
	Target     string             `json:"target"`
	CacheFrom  strslice.StrSlice  `json:"cacheFrom"`
}

type CommandSlice

type CommandSlice []string

func (*CommandSlice) UnmarshalJSON

func (commandSlice *CommandSlice) UnmarshalJSON(bytes []byte) error

type DevcontainerManifest

type DevcontainerManifest struct {
	// Image or Dockerfile specific properties
	Image           string            `json:"image"`
	Dockerfile      string            `json:"dockerFile"`
	Context         string            `json:"context"`
	Build           Build             `json:"build"`
	AppPort         AppPort           `json:"appPort"`
	ContainerEnv    map[string]string `json:"containerEnv"`
	ContainerUser   string            `json:"containerUser"`
	MountStrings    []string          `json:"mounts"`
	WorkspaceMount  string            `json:"workspaceMount"`
	WorkspaceFolder string            `json:"workspaceFolder"`
	RunArgs         []string          `json:"runArgs"`
	// Docker compose specific properties
	DockerComposeFile strslice.StrSlice `json:"dockerComposeFile"`
	Service           string            `json:"service"`
	RunServices       string            `json:"runServices"`
	// General properties
	Name                 string                    `json:"name"`
	ForwardPorts         ForwardPorts              `json:"forwardPorts"`
	PortsAttributes      map[string]PortAttributes `json:"portsAttributes"`
	OtherPortsAttributes map[string]PortAttributes `json:"otherPortsAttributes"`
	RemoteEnv            map[string]string         `json:"remoteEnv"`
	RemoteUser           string                    `json:"remoteUser"`
	UpdateRemoteUserUID  bool                      `json:"updateRemoteUserUID"`
	UserEnvProbe         UserEnvProbe              `json:"userEnvProbe"`
	OverrideCommand      bool                      `json:"overrideCommand"`
	ShutdownAction       ShutdownAction            `json:"shutdownAction"`
	//features -- currently in preview
	// Lifecycle scripts
	InitializeCommand    CommandSlice `json:"initializeCommand"`
	OnCreateCommand      CommandSlice `json:"onCreateCommand"`
	UpdateContentCommand CommandSlice `json:"updateContentCommand"`
	PostCreateCommand    CommandSlice `json:"postCreateCommand"`
	PostStartCommand     CommandSlice `json:"postStartCommand"`
	PostAttachCommand    CommandSlice `json:"postAttachCommand"`
	WaitFor              WaitFor      `json:"waitFor"`
	// Metadata (manually assigned, not marshalled)
	ParentDirectory string
}

func (DevcontainerManifest) AbsDockerBuildContext

func (m DevcontainerManifest) AbsDockerBuildContext() string

func (DevcontainerManifest) AbsDockerfile

func (m DevcontainerManifest) AbsDockerfile() string

func (DevcontainerManifest) Command

func (m DevcontainerManifest) Command() []string

func (DevcontainerManifest) ContainerCreateArgs

func (m DevcontainerManifest) ContainerCreateArgs(imageID string, workingDir string) []string

func (DevcontainerManifest) ContainerEnvSlice

func (m DevcontainerManifest) ContainerEnvSlice() []string

Might want to make this an Unmarshaler?

func (DevcontainerManifest) ContainerExecUser

func (m DevcontainerManifest) ContainerExecUser() string

func (DevcontainerManifest) ContainerName

func (m DevcontainerManifest) ContainerName() string

func (DevcontainerManifest) ExposedPorts

func (m DevcontainerManifest) ExposedPorts() nat.PortSet

func (DevcontainerManifest) ForwardedPorts

func (m DevcontainerManifest) ForwardedPorts() []uint16

func (DevcontainerManifest) GpgMounts

func (m DevcontainerManifest) GpgMounts() []string

func (DevcontainerManifest) ImageBuildArgs

func (m DevcontainerManifest) ImageBuildArgs() []string

func (DevcontainerManifest) ImageTag

func (m DevcontainerManifest) ImageTag() string

func (DevcontainerManifest) Mounts

func (manifest DevcontainerManifest) Mounts(workingDir string) []string

func (DevcontainerManifest) NetworkName

func (m DevcontainerManifest) NetworkName() string

func (DevcontainerManifest) PodName

func (m DevcontainerManifest) PodName() string

func (DevcontainerManifest) PortBindings

func (m DevcontainerManifest) PortBindings() nat.PortMap

func (DevcontainerManifest) RemoteEnvSlice

func (m DevcontainerManifest) RemoteEnvSlice() []string

Might want to make this an Unmarshaler?

func (DevcontainerManifest) ShortHash

func (m DevcontainerManifest) ShortHash() string

func (DevcontainerManifest) SocatContainerName

func (m DevcontainerManifest) SocatContainerName() string

func (DevcontainerManifest) SshMounts

func (m DevcontainerManifest) SshMounts() []string

func (DevcontainerManifest) WorkingDir

func (m DevcontainerManifest) WorkingDir(sublimeTextCompat bool) string

type ForwardPorts

type ForwardPorts []string

func (*ForwardPorts) UnmarshalJSON

func (forwardPorts *ForwardPorts) UnmarshalJSON(bytes []byte) error

type OnAutoForward

type OnAutoForward string
const (
	OnAutoForwardUndefined   OnAutoForward = ""
	OnAutoForwardNotify      OnAutoForward = "notify"
	OnAutoForwardOpenBrowser OnAutoForward = "openBrowser"
	OnAutoForwardOpenPreview OnAutoForward = "openPreview"
	OnAutoForwardSilent      OnAutoForward = "silent"
	OnAutoForwardIgnore      OnAutoForward = "ignore"
)

type PortAttributes

type PortAttributes struct {
	Label            string        `json:"label"`
	Protocol         Protocol      `json:"protocol"`
	OnAutoForward    OnAutoForward `json:"onAutoForward"`
	RequireLocalPort bool          `json:"requireLocalPort"`
	ElevateIfNeeded  bool          `json:"elevateIfNeeded"`
}

type Protocol

type Protocol string
const (
	ProtocolUndefined Protocol = ""
	ProtocolHTTP      Protocol = "http"
	ProtocolHTTPS     Protocol = "https"
)

type ShutdownAction

type ShutdownAction string
const (
	ShutdownActionUndefined     ShutdownAction = ""
	ShutdownActionNone          ShutdownAction = "none"
	ShutdownActionStopContainer ShutdownAction = "stopContainer"
	ShutdownActionStopCompose   ShutdownAction = "stopCompose"
)

type UserEnvProbe

type UserEnvProbe string
const (
	UserEnvProbeUndefined             UserEnvProbe = ""
	UserEnvProbeNone                  UserEnvProbe = "none"
	UserEnvProbeInteractiveShell      UserEnvProbe = "interactiveShell"
	UserEnvProbeLoginShell            UserEnvProbe = "loginShell"
	UserEnvProbeLoginInteractiveShell UserEnvProbe = "loginInteractiveShell"
)

type WaitFor

type WaitFor string
const (
	WaitForUndefined            WaitFor = ""
	WaitForUpdateContentCommand WaitFor = "updateContentCommand"
	WaitForOnCreateCommand      WaitFor = "onCreateCommand"
)

Jump to

Keyboard shortcuts

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