mountspec

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mountspec parses container bind-mount declarations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorKind

type ErrorKind int

ErrorKind identifies the invalid part of a mount declaration.

const (
	InvalidFormat ErrorKind = iota
	EmptySource
	EmptyDestination
	RelativeSource
	RelativeDestination
	InvalidOptions
)

type ParseError

type ParseError struct {
	Kind ErrorKind
}

ParseError describes an invalid mount declaration.

func (*ParseError) Error

func (e *ParseError) Error() string

type Spec

type Spec struct {
	Source      string
	Destination string
	Writable    bool
}

Spec is a parsed bind-mount declaration.

func Parse

func Parse(spec string) (Spec, error)

Parse parses a "source:dest[:mode]" bind-mount declaration. Omitted mode defaults to read-write; mode may contain one "ro" or "rw" option.

func ParseRequiredMode

func ParseRequiredMode(spec string) (Spec, error)

ParseRequiredMode parses a bind-mount declaration that must explicitly include its mode.

Jump to

Keyboard shortcuts

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