config

package
v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DevboxToFile

func DevboxToFile(c *Config, file string) error

Types

type AppConfig

type AppConfig struct {
	StoragePath string `mapstructure:"storage_path" yaml:"storage_path"`
}

func GlobalFromFile

func GlobalFromFile(file string) (AppConfig, error)

func NewAppConfig

func NewAppConfig() *AppConfig

func (*AppConfig) Load

func (c *AppConfig) Load() error

func (*AppConfig) Path

func (c *AppConfig) Path() string

func (*AppConfig) Save

func (c *AppConfig) Save() error

type Binds

type Binds map[string]string

type Commands

type Commands struct {
	Start string `mapstructure:"start"`
	Stop  string `mapstructure:"stop"`
}

type Config

type Config struct {
	Commands Commands `mapstructure:"commands"`
	Limits   Limits   `mapstructure:"limits"`
	Options  Options  `mapstructure:"options"`
	Binds    Binds    `mapstructure:"binds"`
	Env      Env      `mapstructure:"env"`
}

func DevboxFromFile

func DevboxFromFile(file string) (Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) GetEnv

func (c *Config) GetEnv() []string

func (*Config) Load

func (c *Config) Load(file string) error

func (*Config) Save

func (c *Config) Save(file string) error

type Env

type Env struct {
	Shell    string  `mapstructure:"shell"`
	Term     string  `mapstructure:"term"`
	TermInfo string  `mapstructure:"term_info" yaml:"term_info"`
	Path     string  `mapstructure:"path"`
	Home     string  `mapstructure:"home"`
	Vars     EnvVars `mapstructure:"vars"`
}

func (*Env) Get

func (c *Env) Get() []string

type EnvVars

type EnvVars map[string]interface{}

type Limits

type Limits struct {
	CPU  float64      `mapstructure:"cpu"`
	Mem  LimitsMemory `mapstructure:"mem"`
	PIDs int64        `mapstructure:"pids"`
}

func (*Limits) GetCPUQuota

func (dlc *Limits) GetCPUQuota() int64

func (*Limits) GetMemoryLimits

func (dlc *Limits) GetMemoryLimits() (memTotal, memHardMax, memSoftMax, memSwap int64)

func (*Limits) String

func (dlc *Limits) String() string

type LimitsMemory

type LimitsMemory struct {
	Hard float64 `mapstructure:"hard"`
	Soft float64 `mapstructure:"soft"`
	Swap float64 `mapstructure:"swap"`
}

type Options

type Options struct {
	MapUsersAndGroups bool `mapstructure:"map_users_and_groups" yaml:"map_users_and_groups"`
	BindAll           bool `mapstructure:"bind_all" yaml:"bind_all"`
}

type Workspace

type Workspace struct {
	Path     string            `mapstructure:"path"`
	IPs      []string          `mapstructure:"ips"`
	Devboxes []WorkspaceDevbox `mapstructure:"devboxes"`
}

func NewWorkspace

func NewWorkspace(path string) *Workspace

func OpenWorkspace

func OpenWorkspace(file string) (*Workspace, error)

func (*Workspace) Add

func (w *Workspace) Add(name, image string, startDelay int64, c Config)

func (*Workspace) AddIP

func (w *Workspace) AddIP(ip string)

func (*Workspace) Remove

func (w *Workspace) Remove(name string)

func (*Workspace) RemoveIP

func (w *Workspace) RemoveIP(ip string)

func (*Workspace) Save

func (w *Workspace) Save(file string) error

type WorkspaceDevbox

type WorkspaceDevbox struct {
	Name   string `mapstructure:"name"`
	Delay  int64  `mapstructure:"delay"`  // defines how long to wait before starting this devbox
	Image  string `mapstructure:"image"`  // usually this would the tarball eith the latest image
	Config Config `mapstructure:"config"` // a Config object used to configure the workspace
}

Jump to

Keyboard shortcuts

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