Documentation
¶
Overview ¶
Package state is agent-vm's folder, ~/.agent-vm (AGENT_VM_STATE_DIR): the user's files (env, volumes, runtime.sh, setup.sh) and agent-vm's markers, one file per VM and fact, named as 0.2 named them.
Index ¶
- Constants
- type Dir
- func (d Dir) BaseLabel(vm, template string) string
- func (d Dir) Forget(vm, template string) error
- func (d Dir) Marker(kind, vm string) string
- func (d Dir) Path(name string) string
- func (d Dir) Read(name string) string
- func (d Dir) ReadMarker(kind, vm string) string
- func (d Dir) Rename(from, to string) error
- func (d Dir) Write(name string, data []byte) error
Constants ¶
const ( VersionOf = ".agent-vm-version-" // the base's build time it was cloned from BuiltByOf = ".agent-vm-built-by-" // the agent-vm version that built that base SSHFSOf = ".agent-vm-sshfs-" // 0.1 migration done TermOf = ".agent-vm-term-" // the $TERM whose terminfo it has FileMountsOf = ".agent-vm-file-mounts-" // single files of ~/.agent-vm/volumes MountsOf = ".agent-vm-mounts-" // 0.2's record of its shares: only removed now CacheOf = ".agent-vm-sshfs-cache-" // 0.2's record of sshfs's cache: only removed now ScratchOf = ".agent-vm-scratch-" // a --scratch run, with its pid PolicyOf = ".agent-vm-policy-" // fingerprint of the network and guarded policies it booted with )
The markers of a VM.
const ( BaseVersion = ".agent-vm-base-version" BaseBuiltBy = ".agent-vm-base-built-by" )
The base template's markers. BaseVersion, written last by setup, says it can be cloned.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dir ¶
type Dir string
Dir is the state folder.
func Default ¶
Default is $AGENT_VM_STATE_DIR, made absolute so that the checks that keep shares away from it compare real locations, or ~/.agent-vm, spelled as paths.Host does.
func (Dir) BaseLabel ¶
BaseLabel is the base vm was cloned from, for `list`: the agent-vm version that built it, and the day, "-" when not known. The base template describes itself. 0.1.0 recorded no version: a base without one was built by it.
func (Dir) Forget ¶
Forget removes what is known of vm, once deleted. Deleting the base template retires the marker that says it can be cloned.
func (Dir) Read ¶
Read is the content of name in the folder, without its trailing newline, "" when there is none.
func (Dir) ReadMarker ¶
ReadMarker is Read for a marker of vm.