config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultName            = "localpod"
	DefaultImage           = "docker.io/bottlerocketlabs/localpod-base:latest"
	DefaultWorkspaceMount  = "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
	DefaultWorkspaceFolder = "/workspace"
	DefaultRemoteUser      = "dev"
	DefaultContainerUser   = "root"
)

Variables

This section is empty.

Functions

func BuildEnv

func BuildEnv(env map[string]string) []string

Types

type DevContainer

type DevContainer struct {
	Name  string `json:"name"`
	Image string `json:"image"`
	// Dockerfile      string            `json:"dockerfile"`
	// Context         string            `json:"context"`
	Build DevContainerBuild `json:"build,omitempty"`
	// AppPort         []string          `json:"appPort"`
	ContainerEnv    map[string]string `json:"containerEnv"`
	RemoteEnv       map[string]string `json:"remoteEnv"`
	ContainerUser   string            `json:"containerUser"`
	RemoteUser      string            `json:"remoteUser"`
	Mounts          []string          `json:"mounts"`
	WorkspaceMount  string            `json:"workspaceMount"`
	WorkspaceFolder string            `json:"workspaceFolder"`
	RunArgs         []string          `json:"runArgs"`
	OverrideCommand bool              `json:"overrideCommand"`
	ShutdownAction  ShutdownAction    `json:"shutdownAction"`
}

func DefaultDevContainer

func DefaultDevContainer() DevContainer

func DevContainerFromEnv

func DevContainerFromEnv(env Env) (*DevContainer, error)

func DevContainerFromFile

func DevContainerFromFile(r io.Reader) (*DevContainer, error)

func (*DevContainer) AddConfigFromEnv added in v0.1.8

func (dc *DevContainer) AddConfigFromEnv(env Env) error

func (*DevContainer) SHA1 added in v0.0.3

func (cfg *DevContainer) SHA1() string

SHA1 returns the hash with base64 encoding for the configuration

type DevContainerBuild added in v0.0.3

type DevContainerBuild struct {
	Dockerfile string            `json:"dockerfile,omitempty"`
	Context    string            `json:"context,omitempty"`
	Args       map[string]string `json:"args,omitempty"`
	Target     string            `json:"target,omitempty"`
}

type Env

type Env struct {
	// contains filtered or unexported fields
}

Env is abstracted environment

func NewEnv

func NewEnv(environ []string) Env

NewEnv creates a new env from = separated string slice (eg: os.Environ())

func (*Env) Get

func (e *Env) Get(key string) string

Get an environment variable by key, or blank string if missing

func (*Env) Set

func (e *Env) Set(key, value string)

Set adds an environment variable

type ShutdownAction

type ShutdownAction string
const (
	None          ShutdownAction = "none"
	StopContainer                = "stopContainer"
)

func (*ShutdownAction) UnmarshalJSON

func (sa *ShutdownAction) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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