Documentation
¶
Overview ¶
Package paths provides centralized path construction for hypeman data directory.
Index ¶
- Constants
- Variables
- func ValidatePathComponent(value string) error
- type Paths
- func (p *Paths) BuildConfig(id string) string
- func (p *Paths) BuildDir(id string) string
- func (p *Paths) BuildLog(id string) string
- func (p *Paths) BuildLogs(id string) string
- func (p *Paths) BuildMetadata(id string) string
- func (p *Paths) BuildSourceDir(id string) string
- func (p *Paths) BuilderDir(id string) string
- func (p *Paths) BuilderMetadata(id string) string
- func (p *Paths) BuildersDir() string
- func (p *Paths) BuildsDir() string
- func (p *Paths) CaddyBinary(version, arch string) string
- func (p *Paths) CaddyConfig() string
- func (p *Paths) CaddyConfigDir() string
- func (p *Paths) CaddyDataDir() string
- func (p *Paths) CaddyDir() string
- func (p *Paths) CaddyLogFile() string
- func (p *Paths) CaddyPIDFile() string
- func (p *Paths) DataDir() string
- func (p *Paths) DeviceDir(id string) string
- func (p *Paths) DeviceMetadata(id string) string
- func (p *Paths) DevicesDir() string
- func (p *Paths) FirecrackerBinary(version, arch string) string
- func (p *Paths) GuestsDir() string
- func (p *Paths) ImageContentDir(digestHex string) string
- func (p *Paths) ImageContentManifestModel(digestHex string) string
- func (p *Paths) ImageContentMetadata(digestHex string) string
- func (p *Paths) ImageContentPath(digestHex string) string
- func (p *Paths) ImageDigestDir(repository, digestHex string) string
- func (p *Paths) ImageDigestPath(repository, digestHex string) string
- func (p *Paths) ImageLayerArtifactForFormat(layerHex, format string) string
- func (p *Paths) ImageLayerDir(layerHex string) string
- func (p *Paths) ImageLayerRecordForFormat(layerHex, format string) string
- func (p *Paths) ImageLayersDir() string
- func (p *Paths) ImageMetadata(repository, digestHex string) string
- func (p *Paths) ImageRepositoriesDir() string
- func (p *Paths) ImageRepositoryDir(repository string) string
- func (p *Paths) ImageRepositoryTagSymlink(repository, tag string) string
- func (p *Paths) ImageRetentionRepositoryDir(repository string) string
- func (p *Paths) ImageRetentionState(repository, digestHex string) string
- func (p *Paths) ImageTagSymlink(repository, tag string) string
- func (p *Paths) ImagesDir() string
- func (p *Paths) IngressMetadata(id string) string
- func (p *Paths) IngressesDir() string
- func (p *Paths) InstanceAppLog(id string) string
- func (p *Paths) InstanceConfigDisk(id string) string
- func (p *Paths) InstanceDir(id string) string
- func (p *Paths) InstanceHypemanLog(id string) string
- func (p *Paths) InstanceLogs(id string) string
- func (p *Paths) InstanceMacOSAgentDisk(id string) string
- func (p *Paths) InstanceMacOSBootDisk(id string) string
- func (p *Paths) InstanceMetadata(id string) string
- func (p *Paths) InstanceOverlay(id string) string
- func (p *Paths) InstanceRestoreStaging(id string) string
- func (p *Paths) InstanceSWTPMLog(id string) string
- func (p *Paths) InstanceSnapshotBase(id string) string
- func (p *Paths) InstanceSnapshotConfig(id string) string
- func (p *Paths) InstanceSnapshotLatest(id string) string
- func (p *Paths) InstanceSnapshotSchedule(id string) string
- func (p *Paths) InstanceSnapshots(id string) string
- func (p *Paths) InstanceSocket(id string, socketName string) string
- func (p *Paths) InstanceVMMLog(id string) string
- func (p *Paths) InstanceVZShimLog(id string) string
- func (p *Paths) InstanceVolumeOverlay(instanceID, volumeID string) string
- func (p *Paths) InstanceVolumeOverlaysDir(instanceID string) string
- func (p *Paths) InstanceVsockSocket(id string) string
- func (p *Paths) OCICacheBlob(digestHex string) string
- func (p *Paths) OCICacheBlobDir() string
- func (p *Paths) OCICacheIndex() string
- func (p *Paths) OCICacheLayout() string
- func (p *Paths) PushDir(id string) string
- func (p *Paths) PushMetadata(id string) string
- func (p *Paths) PushesDir() string
- func (p *Paths) SnapshotDir(snapshotID string) string
- func (p *Paths) SnapshotGuestDir(snapshotID string) string
- func (p *Paths) SnapshotMetadata(snapshotID string) string
- func (p *Paths) SnapshotSchedulesDir() string
- func (p *Paths) SnapshotStoreDir() string
- func (p *Paths) SystemBinary(version, arch string) string
- func (p *Paths) SystemBuild(ref string) string
- func (p *Paths) SystemImageRetentionDir() string
- func (p *Paths) SystemInitrd(arch string) string
- func (p *Paths) SystemInitrdDir(arch string) string
- func (p *Paths) SystemInitrdLatest(arch string) string
- func (p *Paths) SystemInitrdTimestamp(timestamp, arch string) string
- func (p *Paths) SystemKernel(version, arch string) string
- func (p *Paths) SystemMacOSAgentDisk(version string) string
- func (p *Paths) SystemOCICache() string
- func (p *Paths) VFHealthState() string
- func (p *Paths) VolumeData(id string) string
- func (p *Paths) VolumeDir(id string) string
- func (p *Paths) VolumeMetadata(id string) string
- func (p *Paths) VolumesDir() string
Constants ¶
const InstanceJailDirName = "jail"
InstanceJailDirName is the per-instance directory a jailed VMM's chroot lives under. It is a runtime artifact: snapshot and fork copies skip it, and restore rebuilds it from the instance's own files.
const MacOSAgentDiskFile = "agent.img"
MacOSAgentDiskFile is a macOS guest's copy of the read-only guest agent disk.
const MacOSAuxStorageFile = "mac-aux.img"
MacOSAuxStorageFile is a macOS guest's copy of its image's auxiliary storage.
const MacOSBootDiskFile = "boot.asif"
MacOSBootDiskFile is a macOS guest's writable ASIF overlay, the top of its boot disk chain. The read-only layers below it are cloned from its image.
const RestoreStagingDir = "restore-staging"
RestoreStagingDir holds a macOS restore in progress inside its instance directory, so deleting the instance also deletes any staging it left behind.
Variables ¶
var ErrInvalidPathComponent = errors.New("invalid path component")
ErrInvalidPathComponent is returned when a value cannot be safely joined as one path component.
Functions ¶
func ValidatePathComponent ¶ added in v0.4.0
ValidatePathComponent rejects empty, nested, absolute, and traversing paths.
Types ¶
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
Paths provides typed path construction for the hypeman data directory.
func (*Paths) BuildConfig ¶
BuildConfig returns the path to the build config file (passed to builder VM).
func (*Paths) BuildMetadata ¶
BuildMetadata returns the path to build metadata.json.
func (*Paths) BuildSourceDir ¶
BuildSourceDir returns the path to the source directory for a build.
func (*Paths) BuilderDir ¶ added in v0.3.0
BuilderDir returns the directory for a specific builder.
func (*Paths) BuilderMetadata ¶ added in v0.3.0
BuilderMetadata returns the path to builder metadata.json.
func (*Paths) BuildersDir ¶ added in v0.3.0
BuildersDir returns the root builders directory.
func (*Paths) CaddyBinary ¶
CaddyBinary returns the path to the caddy binary.
func (*Paths) CaddyConfig ¶
CaddyConfig returns the path to the caddy config file.
func (*Paths) CaddyConfigDir ¶
CaddyConfigDir returns the path to Caddy's config directory.
func (*Paths) CaddyDataDir ¶
CaddyDataDir returns the path to Caddy's data directory (for certs, etc.).
func (*Paths) CaddyLogFile ¶
CaddyLogFile returns the path to the caddy log file.
func (*Paths) CaddyPIDFile ¶
CaddyPIDFile returns the path to the caddy PID file.
func (*Paths) DeviceMetadata ¶
DeviceMetadata returns the path to device metadata.json.
func (*Paths) DevicesDir ¶
DevicesDir returns the root devices directory.
func (*Paths) FirecrackerBinary ¶ added in v0.0.7
FirecrackerBinary returns the path to a firecracker VMM binary.
func (*Paths) ImageContentDir ¶ added in v0.4.0
ImageContentDir returns the directory for content-addressed image data.
func (*Paths) ImageContentManifestModel ¶ added in v0.4.0
ImageContentManifestModel returns the path to the persisted OCI manifest model (layer descriptors, config, platform) for content-addressed image data.
func (*Paths) ImageContentMetadata ¶ added in v0.4.0
ImageContentMetadata returns the path to metadata for content-addressed image data.
func (*Paths) ImageContentPath ¶ added in v0.4.0
ImageContentPath returns the path to a content-addressed rootfs disk file.
func (*Paths) ImageDigestDir ¶
ImageDigestDir returns the directory for a specific image digest.
func (*Paths) ImageDigestPath ¶
ImageDigestPath returns the path to the rootfs disk file for a digest. Uses .erofs on Linux (compressed) and .ext4 on Darwin (VZ kernel lacks erofs support).
func (*Paths) ImageLayerArtifactForFormat ¶ added in v0.4.0
ImageLayerArtifactForFormat returns the path to a materialized layer artifact.
func (*Paths) ImageLayerDir ¶ added in v0.4.0
ImageLayerDir returns the artifact directory for one layer digest.
func (*Paths) ImageLayerRecordForFormat ¶ added in v0.4.0
ImageLayerRecordForFormat returns the path to the artifact record for one materialized layer and format.
func (*Paths) ImageLayersDir ¶ added in v0.4.0
ImageLayersDir returns the root directory of the per-layer artifact store. Layer artifacts are content-addressed by the compressed layer blob digest.
func (*Paths) ImageMetadata ¶
ImageMetadata returns the path to metadata.json for a digest.
func (*Paths) ImageRepositoriesDir ¶ added in v0.4.0
ImageRepositoriesDir returns the root directory for repository tag references.
func (*Paths) ImageRepositoryDir ¶
ImageRepositoryDir returns the directory for an image repository.
func (*Paths) ImageRepositoryTagSymlink ¶ added in v0.4.0
ImageRepositoryTagSymlink returns the path to a tag reference in the new layout.
func (*Paths) ImageRetentionRepositoryDir ¶ added in v0.1.0
ImageRetentionRepositoryDir returns the directory for image retention state for one repository.
func (*Paths) ImageRetentionState ¶ added in v0.1.0
ImageRetentionState returns the state file path for one retained image digest.
func (*Paths) ImageTagSymlink ¶
ImageTagSymlink returns the path to a tag symlink.
func (*Paths) IngressMetadata ¶
IngressMetadata returns the path to ingress metadata.json.
func (*Paths) IngressesDir ¶
IngressesDir returns the root ingresses directory.
func (*Paths) InstanceAppLog ¶
InstanceAppLog returns the path to instance application log (guest serial console).
func (*Paths) InstanceConfigDisk ¶
InstanceConfigDisk returns the path to instance config disk.
func (*Paths) InstanceDir ¶
InstanceDir returns the directory for an instance.
func (*Paths) InstanceHypemanLog ¶
InstanceHypemanLog returns the path to instance hypeman operations log.
func (*Paths) InstanceLogs ¶
InstanceLogs returns the path to instance logs directory.
func (*Paths) InstanceMacOSAgentDisk ¶ added in v0.4.0
InstanceMacOSAgentDisk returns the path to a macOS guest's guest agent disk.
func (*Paths) InstanceMacOSBootDisk ¶ added in v0.4.0
InstanceMacOSBootDisk returns the path to a macOS guest's boot disk.
func (*Paths) InstanceMetadata ¶
InstanceMetadata returns the path to instance metadata.json.
func (*Paths) InstanceOverlay ¶
InstanceOverlay returns the path to instance overlay disk.
func (*Paths) InstanceRestoreStaging ¶ added in v0.4.0
InstanceRestoreStaging returns the path to an instance's restore staging directory.
func (*Paths) InstanceSWTPMLog ¶ added in v0.4.0
InstanceSWTPMLog returns the path to the instance software TPM log.
func (*Paths) InstanceSnapshotBase ¶ added in v0.1.0
InstanceSnapshotBase returns the hidden retained snapshot base.
func (*Paths) InstanceSnapshotConfig ¶
InstanceSnapshotConfig returns the path to the snapshot config.json file. Cloud Hypervisor creates config.json in the snapshot directory.
func (*Paths) InstanceSnapshotLatest ¶
InstanceSnapshotLatest returns the path to the latest snapshot directory.
func (*Paths) InstanceSnapshotSchedule ¶ added in v0.1.0
InstanceSnapshotSchedule returns the path to the snapshot schedule config.
func (*Paths) InstanceSnapshots ¶
InstanceSnapshots returns the path to instance snapshots directory.
func (*Paths) InstanceSocket ¶
InstanceSocket returns the path to instance API socket. The socketName should be obtained from hypervisor.Type.SocketName() to ensure it stays within Unix socket path length limits (SUN_LEN ~108 bytes).
func (*Paths) InstanceVMMLog ¶
InstanceVMMLog returns the path to instance VMM log (Cloud Hypervisor stdout+stderr).
func (*Paths) InstanceVZShimLog ¶ added in v0.4.0
InstanceVZShimLog returns the path to the Virtualization.framework shim log, which is the VMM log for VZ guests.
func (*Paths) InstanceVolumeOverlay ¶
InstanceVolumeOverlay returns the path to a volume's overlay disk for an instance.
func (*Paths) InstanceVolumeOverlaysDir ¶
InstanceVolumeOverlaysDir returns the directory for volume overlays.
func (*Paths) InstanceVsockSocket ¶
InstanceVsockSocket returns the path to instance vsock socket.
func (*Paths) OCICacheBlob ¶
OCICacheBlob returns the path to a specific blob in the OCI cache.
func (*Paths) OCICacheBlobDir ¶
OCICacheBlobDir returns the path to the OCI cache blobs directory.
func (*Paths) OCICacheIndex ¶
OCICacheIndex returns the path to the OCI cache index.json.
func (*Paths) OCICacheLayout ¶
OCICacheLayout returns the path to the OCI cache oci-layout file.
func (*Paths) PushMetadata ¶ added in v0.4.0
PushMetadata returns the path to push metadata.json.
func (*Paths) SnapshotDir ¶ added in v0.1.0
SnapshotDir returns the directory for a specific snapshot.
func (*Paths) SnapshotGuestDir ¶ added in v0.1.0
SnapshotGuestDir returns the path to the copied guest payload for a snapshot.
func (*Paths) SnapshotMetadata ¶ added in v0.1.0
SnapshotMetadata returns the path to snapshot metadata.json.
func (*Paths) SnapshotSchedulesDir ¶ added in v0.1.0
SnapshotSchedulesDir returns the root directory for instance snapshot schedules.
func (*Paths) SnapshotStoreDir ¶ added in v0.1.0
SnapshotStoreDir returns the root directory for centrally managed snapshots.
func (*Paths) SystemBinary ¶
SystemBinary returns the path to a VMM binary.
func (*Paths) SystemBuild ¶
SystemBuild returns the path to a system build directory.
func (*Paths) SystemImageRetentionDir ¶ added in v0.1.0
SystemImageRetentionDir returns the path to persisted image retention state.
func (*Paths) SystemInitrd ¶
SystemInitrd returns the path to the latest initrd symlink.
func (*Paths) SystemInitrdDir ¶
SystemInitrdDir returns the directory for initrd builds for an architecture.
func (*Paths) SystemInitrdLatest ¶
SystemInitrdLatest returns the path to the latest symlink (same as SystemInitrd).
func (*Paths) SystemInitrdTimestamp ¶
SystemInitrdTimestamp returns the path to a specific timestamped initrd build.
func (*Paths) SystemKernel ¶
SystemKernel returns the path to a kernel file.
func (*Paths) SystemMacOSAgentDisk ¶ added in v0.4.0
SystemMacOSAgentDisk returns the path to the guest agent disk built for an agent version, from which macOS guests take their copies.
func (*Paths) SystemOCICache ¶
SystemOCICache returns the path to the OCI cache directory.
func (*Paths) VFHealthState ¶ added in v0.4.0
VFHealthState returns the path to the persisted vGPU VF health file.
func (*Paths) VolumeData ¶
VolumeData returns the path to the volume data file.
func (*Paths) VolumeMetadata ¶
VolumeMetadata returns the path to volume metadata.json.
func (*Paths) VolumesDir ¶
VolumesDir returns the root volumes directory.