mounts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOverlayMount

func CreateOverlayMount(ctx context.Context, opts OverlayMountOptions) error

CreateOverlayMount 创建一个 Overlay 挂载

Types

type Mount

type Mount interface {
	// ID 返回挂载 ID
	ID() uid.UID
	// MountPath 返回挂载点绝对路径
	MountPath() string
	// Mount 挂载
	Mount(ctx context.Context) error
	// Umount 卸载
	Umount(ctx context.Context) error
	// CreateSymlink 在指定路径创建访问挂载点的软链
	CreateSymlink(ctx context.Context, path string) error
}

Mount 挂载

func New

func New(ctx context.Context, id uid.UID, layers []layers.Layer, opts MountOptions) (Mount, error)

New 创建一个挂载

layers 中第 0 到 n-2 个元素是 lower 层,其中 n-2 层是最顶层。第 n-1 层是 upper 层。

func NewMountedMount

func NewMountedMount(id uid.UID, opts MountOptions) Mount

NewMountedMount 创建一个已经挂载的挂载

type MountOptions

type MountOptions struct {
	MountDataRoot string
	ChownUID      int
	ChownGID      int
}

MountOptions 挂载选项

type OverlayMountOptions

type OverlayMountOptions struct {
	// 挂载来源(挂载点名)
	// 默认为 overlay
	Source string
	// 挂载点路径
	MountPath string
	// OverlayFS lowerdir
	LowerDir []string
	// OverlayFS upperdir
	UpperDir string
	// OverlayFS workdir
	WorkDir string
	// 是否只读挂载
	ReadOnly bool
}

OverlayMountOptions OverlayFS 挂载选项

Jump to

Keyboard shortcuts

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