package
0.0.2
Repository: https://github.com/yubo/golib.git
Documentation: pkg.go.dev

# Functions

AddSystemdScope adds "system-run --scope" to given command line If args contains sensitive material, use AddSystemdScopeSensitive to construct a safe to log string.
AddSystemdScopeSensitive adds "system-run --scope" to given command line It also accepts takes a sanitized string containing mount arguments, mountArgsLogStr, and returns the string appended to the systemd command for logging.
CleanupMountPoint unmounts the given path and deletes the remaining directory if successful.
GetDeviceNameFromMount given a mnt point, find the device from /proc/mounts returns the device name, reference count, and error code.
IsCorruptedMnt return true if err is about corrupted mount point.
IsNotMountPoint determines if a directory is a mountpoint.
ListProcMounts is shared with NsEnterMounter.
MakeBindOpts detects whether a bind mount is being requested and makes the remount options to use in case of bind mount, due to the fact that bind mount doesn't respect mount options.
MakeBindOptsSensitive is the same as MakeBindOpts but this method allows sensitiveOptions to be passed in a separate parameter from the normal mount options and ensures the sensitiveOptions are never logged.
MakeMountArgs makes the arguments to the mount(8) command.
MakeMountArgsSensitive makes the arguments to the mount(8) command.
New returns a mount.Interface for the current system.
NewFakeMounter returns a FakeMounter struct that implements Interface and is suitable for testing purposes.
No description provided by the author
ParseMountInfo parses /proc/xxx/mountinfo.
PathExists returns true if the specified path exists.
PathWithinBase checks if give path is within given base directory.
SearchMountPoints finds all mount references to the source, returns a list of mountpoints.
StartsWithBackstep checks if the given path starts with a backstep segment.

# Constants

FakeActionMount is the string for specifying mount as FakeAction.Action.
FakeActionUnmount is the string for specifying unmount as FakeAction.Action.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

FakeAction objects are logged every time a fake mount or unmount is called.
FakeMounter implements mount.Interface for tests.
Mounter provides the default implementation of mount.Interface for the linux platform.
No description provided by the author
MountInfo represents a single line in /proc/<pid>/mountinfo.
MountPoint represents a single line in /proc/mounts or /etc/fstab.
SafeFormatAndMount probes a device to see if it is formatted.

# Interfaces

Interface defines the set of methods to allow for mount operations on a system.

# Type aliases

No description provided by the author
UnmountFunc is a function callback to be executed during the Unmount() call.