Documentation ¶
Overview ¶
Package devbox provides state management functionality to the Cobra CLI cmds.
Index ¶
Constants ¶
const DefaultStateFile = "~/.devbox.state.yaml"
DefaultStateFile defines the default location of the state file.
Variables ¶
var DefaultConfig = Config{ Image: "github.com/mojochao/devbox-base", User: "developer", Shell: "sh", Name: fmt.Sprintf("devbox-%s", getCurrentUsername()), Namespace: "", Kubeconfig: "", Description: "", }
DefaultConfig is a Config containing default configuration values.
var ManifestTypes = []string{
"bash",
"zsh",
"git",
"ssh",
"tmux",
"vim",
"emacs",
}
ManifestTypes contains the list of defaultManifest types in install order.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct { // Image of devbox running in Docker container or Kubernetes pod. Image string `yaml:"image"` // User in docker container or Kubernetes pod running devbox image. User string `yaml:"user"` // Shell to exec in devbox running in Docker container or Kubernetes pod. Shell string `yaml:"shell"` // Name of Docker container or Kubernetes pod running devbox image. Name string `yaml:"name"` // Namespace is namespace of Kubernetes cluster hosting devbox pod. Namespace string `yaml:"namespace"` // Kubeconfig is path to kubeconfig of Kubernetes cluster hosting devbox pod. Kubeconfig string `yaml:"kubeconfig"` // Description of devbox. Description string `yaml:"description"` // Manifest of devbox. Manifest Manifest `yaml:"defaultManifest"` }
Box contains information on a devbox.
type BoxID ¶
type BoxID = string
BoxID is an identifier for a devbox persisted in application state.
type Config ¶
type Config struct { // Image of devbox running in Docker container or Kubernetes pod. Image string // User in docker container or Kubernetes pod running devbox image. User string // Shell to exec in devbox running in Docker container or Kubernetes pod. Shell string // Name of Docker container or Kubernetes pod running devbox image. Name string // Namespace is namespace of Kubernetes cluster hosting devbox pod. Namespace string // Kubeconfig is path to kubeconfig of Kubernetes cluster hosting devbox pod. Kubeconfig string // Description of devbox. Description string }
Config contains configuration data required of a Box.
type Manifest ¶
type Manifest = map[ManifestType][]ManifestItem
Manifest contains a map of ManifestItem values by their type key.
type ManifestItem ¶
type ManifestItem struct { Path string `yaml:"path,omitempty"` Commands []string `yaml:"commands,omitempty"` }
ManifestItem contains optional path and commands to use when setting up that item.
type ManifestType ¶
type ManifestType = string
ManifestType identifies the type of ManifestItem values.
type State ¶
type State struct { // Active is the ID of the active devbox context, if any. Active BoxID `yaml:"active"` // Boxes is the map of added Box items by ID. Boxes Boxes `yaml:"boxes"` // Path is the path to the state file. Path string `yaml:"path"` }
State contains devbox state.
func (State) ContainsDevbox ¶
ContainsDevbox tests if a Box is in State.
func (State) RemoveDevbox ¶
RemoveDevbox removes a Box from State.