vpath

package
v0.0.0-...-dea5896 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package vpath is a helper package easing the expansion of a virtual path like vol1/etc/nginx.conf to a host path like /srv/svc1data.ns1.vol.clu1/etc/nginx.conf

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccess = errors.New("vol is not accessible")
)

Functions

func HostDevpath

func HostDevpath(s string, namespace string) (string, error)

HostDevpath returns host device path for a volume translation rules: INPUT VOL OUPUT COMMENT /path /dev/sda1 loop dev /dev/sda1 /dev/sda1 host full path myvol myvol /dev/sda1 vol dev path in host

func HostDevpaths

func HostDevpaths(l []string, namespace string) ([]string, error)

HostDevpaths applies the HostDevpath function to each path of the input list

func HostPath

func HostPath(s string, namespace string) (string, error)

HostPath expand a volume-relative path to a host full path.

Example:

INPUT VOL OUPUT COMMENT /path /path host full path myvol/path myvol /srv/myvol/path vol head relative path

func HostPathAndVol

func HostPathAndVol(s string, namespace string) (hostPath string, vol object.Vol, err error)

HostPathAndVol expand a volume-relative path to a host full path. It returns the host full path and the associated object volume if defined.

Example:

INPUT VOL host path COMMENT /path nil /path host full path myvol/path myvol /srv/myvol/path vol head relative path

func HostPaths

func HostPaths(l []string, namespace string) ([]string, error)

HostPaths applies the HostPath function to each path of the input list

Types

This section is empty.

Jump to

Keyboard shortcuts

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