Help us shape the future of Go! Take the 2026 Go Developer Survey

fuse

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindMount

func BindMount(source, target string, readOnly bool) error

BindMount creates a bind mount.

BUG-01 fix: the kernel ignores MS_RDONLY on the initial bind mount call. Making a bind mount read-only requires a second, separate mount call with MS_BIND | MS_REMOUNT | MS_RDONLY.

func CleanupMounts

func CleanupMounts(path string) error

CleanupMounts unmounts all mounts recursively from a path.

func CopyDir

func CopyDir(src, dst string) error

CopyDir recursively copies a directory.

func DevMount

func DevMount(target string) error

DevMount mounts /dev inside a container (tmpfs-based).

func DevPtsMount

func DevPtsMount(target string) error

DevPtsMount mounts /dev/pts inside a container.

func EnsureMountedDir

func EnsureMountedDir(source, target, fstype string, flags uintptr, data string) error

EnsureMountedDir ensures a directory is mounted.

func GenerateHostname

func GenerateHostname(hostname string) string

GenerateHostname generates a hostname file.

func GenerateHosts

func GenerateHosts(hostname string, extraHosts map[string]string) string

GenerateHosts generates a /etc/hosts file.

func GenerateResolvConf

func GenerateResolvConf(dnsServers []string, searchDomains []string, options []string, internalDNS ...string) string

GenerateResolvConf generates a resolv.conf file. If internalDNS is provided, it is added as the first nameserver (containers use the internal DNS server for container name resolution). Port is stripped from nameserver addresses — resolv.conf does not support port-qualified nameservers.

func IsFuseOverlayfsAvailable

func IsFuseOverlayfsAvailable() bool

IsFuseOverlayfsAvailable checks if fuse-overlayfs is installed.

func IsFusermountAvailable

func IsFusermountAvailable() bool

IsFusermountAvailable checks if fusermount is available.

func MqueueMount

func MqueueMount(target string) error

MqueueMount mounts /dev/mqueue inside a container.

func PrepareRootfs

func PrepareRootfs(rootfs string, files map[string]string, user ...string) error

PrepareRootfs prepares a rootfs directory with proper permissions.

func ProcMount

func ProcMount(target string) error

ProcMount mounts /proc inside a container.

func ShmMount

func ShmMount(target string, sizeBytes int64) error

ShmMount mounts /dev/shm inside a container.

func SysMount

func SysMount(target string) error

SysMount mounts /sys inside a container.

func TmpfsMount

func TmpfsMount(target string, sizeBytes int64, mode uint32) error

TmpfsMount creates a tmpfs mount.

Types

type OverlayFS

type OverlayFS struct {
	// contains filtered or unexported fields
}

OverlayFS implements a rootless overlay filesystem using fuse-overlayfs.

func NewOverlayFS

func NewOverlayFS(workDir string) *OverlayFS

NewOverlayFS creates a new FUSE overlay filesystem manager.

func (*OverlayFS) Mount

func (o *OverlayFS) Mount(lowerDirs []string, upperDir, target string) error

Mount mounts an overlay filesystem at the target path.

func (*OverlayFS) Unmount

func (o *OverlayFS) Unmount(target string) error

Unmount unmounts a FUSE overlay filesystem.

func (*OverlayFS) UnmountForce

func (o *OverlayFS) UnmountForce(target string) error

UnmountForce force-unmounts a mount point.

Jump to

Keyboard shortcuts

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