Documentation ¶
Index ¶
- Constants
- Variables
- func WithDefaults(v *VCFG, logger elog.View) error
- type Bytes
- func (x *Bytes) Align(unit Bytes)
- func (x *Bytes) ApplyDelta(delta Bytes)
- func (x Bytes) IsAligned(unit Bytes) bool
- func (x Bytes) IsDelta() bool
- func (x Bytes) MarshalJSON() ([]byte, error)
- func (x Bytes) MarshalText() (text []byte, err error)
- func (x Bytes) String() string
- func (x Bytes) Units(unit Bytes) int
- func (x *Bytes) UnmarshalJSON(data []byte) error
- func (x *Bytes) UnmarshalText(text []byte) error
- type Command
- type Duration
- type Filesystem
- type InodesQuota
- type Logging
- type NFSSettings
- type NetworkInterface
- type PackageInfo
- type Privilege
- type Program
- type Route
- type Size
- func (x *Size) Align(unit Size)
- func (x *Size) ApplyDelta(delta Size)
- func (x Size) IsAligned(unit Size) bool
- func (x Size) IsDelta() bool
- func (x Size) MarshalJSON() ([]byte, error)
- func (x Size) MarshalText() (text []byte, err error)
- func (x Size) String() string
- func (x Size) Units(unit Size) int
- func (x *Size) UnmarshalJSON(data []byte) error
- func (x *Size) UnmarshalText(text []byte) error
- type StdoutMode
- type SystemSettings
- type TerminateSignal
- type Timestamp
- func (x Timestamp) MarshalJSON() ([]byte, error)
- func (x Timestamp) MarshalText() (text []byte, err error)
- func (x Timestamp) String() string
- func (x Timestamp) Time() time.Time
- func (x Timestamp) Unix() int64
- func (x *Timestamp) UnmarshalJSON(data []byte) error
- func (x *Timestamp) UnmarshalText(text []byte) error
- type URL
- type VCFG
- func (vcfg *VCFG) File() (vio.File, error)
- func (vcfg *VCFG) Format(f fmt.State, c rune)
- func (vcfg *VCFG) Load(data []byte) error
- func (vcfg *VCFG) LoadFile(f vio.File) error
- func (vcfg *VCFG) LoadFilepath(path string) error
- func (vcfg *VCFG) Marshal() ([]byte, error)
- func (vcfg *VCFG) Merge(x *VCFG) error
- func (vcfg *VCFG) ModTime() time.Time
- func (vcfg *VCFG) SaltedHostname() string
- type VMSettings
- type ZerothArg
Constants ¶
const ( BootstrapWaitFile = "WAIT_FILE" BootstrapWaitPort = "WAIT_PORT" BootstrapSleep = "SLEEP" BootstrapFindAndReplace = "FIND_AND_REPLACE" BootstrapGetRequest = "GET" )
Bootstrap commands
Variables ¶
var ( Ext2FS = Filesystem("ext2") Ext4FS = Filesystem("ext4") XFS = Filesystem("xfs") )
Supported filesystem types
var ( //RootPrivilege: root privilege level, has full rights to everything and will run as the 'root' suer RootPrivilege = Privilege("root") //SuperuserPrivilege: sudo user level privileges, and will run as the configured user SuperuserPrivilege = Privilege("superuser") //SuperuserPrivilege: non-root level privileges, and will run as the configured user UserPrivilege = Privilege("user") )
var TerminateSignals = map[TerminateSignal]syscall.Signal{ "SIGINT": syscall.Signal(0x2), "SIGKILL": syscall.Signal(0x9), "SIGQUIT": syscall.Signal(0x3), "SIGPWR": syscall.Signal(0x1e), "SIGSTOP": syscall.Signal(0x13), "SIGTERM": syscall.Signal(0xf), "SIGUSR1": syscall.Signal(0xa), "SIGUSR2": syscall.Signal(0xc), }
TerminateSignals : Supported Signals
Functions ¶
Types ¶
type Bytes ¶
type Bytes Size
Bytes is a wrapper around Size used to easily parse, marshal, and convert different equivalent representations of size in bytes. Its only real difference compared to Size is in how strings and created and parsed.
const ( Byte Bytes = 0x1 // a single byte KiB Bytes = 0x400 // a kibibyte (1024 bytes) MiB Bytes = 0x100000 // a mibibyte (1024 kibibytes) GiB Bytes = 0x40000000 // a gibibyte (1024 mibibytes) )
Common byte constants
func ParseBytes ¶
ParseBytes resolves a string into a Bytes object.
func (*Bytes) Align ¶
Align increases the number of bytes if necessary to make it aligned to the unit.
func (*Bytes) ApplyDelta ¶
ApplyDelta adds the delta provided to the Bytes object.
func (Bytes) IsAligned ¶
IsAligned returns true if the number of bytes is an integer multiple of the unit.
func (Bytes) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (Bytes) MarshalText ¶
MarshalText implements encoding.TextMarshaler. This interface is used by toml processing packages based on github.com/BurntSushi/toml.
func (*Bytes) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Bytes) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. This interface is used by toml processing packages based on github.com/BurntSushi/toml.
type Duration ¶
Duration specifies the a duration of time.
func (Duration) MarshalText ¶
MarshalText ..
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Duration) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Filesystem ¶
type Filesystem string
Filesystem instructs the compiler to use a specific filesystem format
type InodesQuota ¶
type InodesQuota int
InodesQuota specifies the minimum number of inodes that must exist on a compiled file-system.
func (*InodesQuota) TextUnmarshaler ¶
func (x *InodesQuota) TextUnmarshaler(text []byte) error
TextUnmarshaler implements encoding.TextUnmarshaler.
func (*InodesQuota) UnmarshalJSON ¶
func (x *InodesQuota) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type Logging ¶
type Logging struct { Config []string `toml:"config,omitempty" json:"config,omitempty"` Type string `toml:"type,omitempty" json:"type,omitempty"` }
Logging ..
type NFSSettings ¶
type NFSSettings struct { MountPoint string `toml:"mount,omitempty" json:"mount"` Server string `toml:"server,omitempty" json:"server"` Arguments string `toml:"options,omitempty" json:"options"` }
NFSSettings ..
type NetworkInterface ¶
type NetworkInterface struct { IP string `toml:"ip,omitempty" json:"ip"` Mask string `toml:"mask,omitempty" json:"mask,omitempty"` Gateway string `toml:"gateway,omitempty" json:"gateway,omitempty"` UDP []string `toml:"udp,omitempty" json:"udp,omitempty"` TCP []string `toml:"tcp,omitempty" json:"tcp,omitempty"` HTTP []string `toml:"http,omitempty" json:"http,omitempty"` HTTPS []string `toml:"https,omitempty" json:"https,omitempty"` MTU uint `toml:"mtu,omitzero" json:"mtu,omitempty"` DisableTCPSegmentationOffloading bool `toml:"disable-tso,omitempty" json:"disable-tso,omitempty"` TCPDUMP bool `toml:"tcpdump,omitempty" json:"tcpdump"` }
NetworkInterface ..
type PackageInfo ¶
type PackageInfo struct { Name string `toml:"name,omitempty" json:"name,omitempty"` Author string `toml:"author,omitempty" json:"author,omitempty"` Summary string `toml:"summary,omitempty" json:"summary,omitempty"` Description string `toml:"description,omitempty" json:"description,omitempty"` URL URL `toml:"url,omitempty" json:"url,omitempty"` Date Timestamp `toml:"date,omitempty,omitzero" json:"date,omitempty"` Version string `toml:"version,omitempty" json:"version,omitempty"` }
PackageInfo ..
type Privilege ¶
type Privilege string
Privilege: The privilege level that the machine user will bet set with.
Additional information can be found @ https://support.vorteil.io/docs/VCFG-Reference/program/privilege
type Program ¶
type Program struct { Binary string `toml:"binary,omitempty" json:"binary"` Args string `toml:"args,omitempty" json:"args"` Env []string `toml:"env,omitempty" json:"env"` Cwd string `toml:"cwd,omitempty" json:"cwd"` Stdout string `toml:"stdout,omitempty" json:"stdout"` Stderr string `toml:"stderr,omitempty" json:"stderr"` Bootstrap []string `toml:"bootstrap,ommitempty" json:"bootstrap"` LogFiles []string `toml:"logfiles,omitempty" json:"logfiles"` Privilege Privilege `toml:"privilege,omitempty" json:"privilege"` Strace bool `toml:"strace,omitempty" json:"strace"` Terminate TerminateSignal `toml:"terminate,omitempty" json:"terminate"` }
Program ..
func (*Program) ProgramArgs ¶
type Route ¶
type Route struct { Interface string `toml:"interface,omitempty" json:"interface,omitempty"` Destination string `toml:"destination,omitempty" json:"destination,omitempty"` Gateway string `toml:"gateway,omitempty" json:"gateway,omitempty"` }
Route ..
type Size ¶
type Size int
Size is a wrapper around int used to easily parse, marshal, and convert different equivalent representations of quantities.
func (*Size) ApplyDelta ¶
ApplyDelta adds the delta provided to the Size object.
func (Size) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (Size) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Size) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Size) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type StdoutMode ¶
type StdoutMode int
StdoutMode ..
const ( StdoutModeDefault StdoutMode = iota StdoutModeStandard StdoutModeScreenOnly StdoutModeSerialOnly StdoutModeDisabled StdoutModeUnknown )
..
func (StdoutMode) MarshalText ¶
func (x StdoutMode) MarshalText() (text []byte, err error)
MarshalText ..
func (*StdoutMode) UnmarshalJSON ¶
func (x *StdoutMode) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
func (*StdoutMode) UnmarshalText ¶
func (x *StdoutMode) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type SystemSettings ¶
type SystemSettings struct { DNS []string `toml:"dns,omitempty" json:"dns,omitempty"` NTP []string `toml:"ntp,omitempty" json:"ntp,omitempty"` Hostname string `toml:"hostname,omitempty" json:"hostname,omitempty"` MaxFDs uint `toml:"max-fds,omitzero" json:"max-fds,omitempty"` StdoutMode StdoutMode `toml:"output-mode,omitzero" json:"stdout-mode,omitempty"` KernelArgs string `toml:"kernel-args,omitempty" json:"kernel-args,omitempty"` Filesystem Filesystem `toml:"filesystem,omitempty" json:"filesystem,omitempty"` User string `toml:"user,omitempty" json:"user,omitempty"` // Note: should we validate against regex ^[a-z]*$ TerminateWait uint `toml:"terminate-wait,omitzero" json:"terminate-wait,omitzero"` }
SystemSettings ..
type TerminateSignal ¶
type TerminateSignal string
TerminateSignal : The Signal to send to a program on termination
Additional information can be found @ https://support.vorteil.io/docs/VCFG-Reference/program/terminate
const DefaultTerminateSignal TerminateSignal = "SIGTERM"
DefaultTerminateSignal : Default Terminate Signal to be used on programs
func (*TerminateSignal) Signal ¶
func (tSig *TerminateSignal) Signal() (syscall.Signal, error)
Signal : Return syscall Signal
func (*TerminateSignal) Validate ¶
func (tSig *TerminateSignal) Validate() (err error)
Validate : Check if TerminateSignal is a supported signal
type Timestamp ¶
type Timestamp struct {
// contains filtered or unexported fields
}
Timestamp specifies the a date and time.
func TimestampFromString ¶
TimestampFromString ..
func (Timestamp) MarshalText ¶
MarshalText ..
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*Timestamp) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type URL ¶
type URL string
URL is a customized string for validating urls unmarshalled from json or toml.
func URLFromString ¶
URLFromString resolves a string into Args.
func (*URL) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*URL) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type VCFG ¶
type VCFG struct { Programs []Program `toml:"program,omitempty" json:"program,omitempty"` Networks []NetworkInterface `toml:"network,omitempty" json:"network,omitempty"` System SystemSettings `toml:"system,omitempty" json:"system,omitempty"` Info PackageInfo `toml:"info,omitempty" json:"info,omitempty"` VM VMSettings `toml:"vm,omitempty" json:"vm,omitempty"` NFS []NFSSettings `toml:"nfs,omitempty" json:"nfs,omitempty"` Routing []Route `toml:"route,omitempty" json:"route,omitempty"` Logging []Logging `toml:"logging,omitempty" json:"logging,omitempty"` Sysctl map[string]string `toml:"sysctl,omitempty" json:"sysctl,omitempty"` // contains filtered or unexported fields }
VCFG ..
func (*VCFG) SaltedHostname ¶
type VMSettings ¶
type VMSettings struct { CPUs uint `toml:"cpus,omitzero" json:"cpus,omitempty"` RAM Bytes `toml:"ram,omitzero" json:"ram,omitempty"` Inodes InodesQuota `toml:"inodes,omitzero" json:"inodes,omitempty"` Kernel string `toml:"kernel,omitempty" json:"kernel,omitempty"` DiskSize Bytes `toml:"disk-size,omitzero" json:"disk-size,omitempty"` }
VMSettings ..
type ZerothArg ¶
type ZerothArg string
A ZerothArg is a customized string with checks for compatibility with image-building logic.
func ZerothArgFromString ¶
ZerothArgFromString resolves a string into a ZerothArg.
func (*ZerothArg) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
func (*ZerothArg) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.