utils

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package utils provides common utils for connector

Package utils provides common utils for connector

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindMountRawBlockDevice

func BindMountRawBlockDevice(ctx context.Context, sourcePath, targetPath string, mountFlags []string) error

BindMountRawBlockDevice mounts the raw block device to target path

func ContainSourceDevice

func ContainSourceDevice(ctx context.Context, targetPath, sourceDev string) bool

ContainSourceDevice used to check whether target path referenced source device is equal to sourceDev

func GetMultiPathInfo

func GetMultiPathInfo(connectionProperties map[string]interface{}) (bool, string, error)

GetMultiPathInfo is used to obtain MultiPath configuration information.

func Mount

func Mount(ctx context.Context, sourcePath, targetPath string, flags MountParam, checkSourcePath bool) error

Mount mounts source to target with given flags.

func MountToDir

func MountToDir(ctx context.Context, sourcePath, targetPath string, flags MountParam, checkSourcePath bool) error

MountToDir mounts source to target which is a directory.

func Unmount

func Unmount(ctx context.Context, targetPath string) error

Unmount unmounts the target path

func VerifyMultipathService

func VerifyMultipathService(requiredServices []string, forbiddenServices []string) error

VerifyMultipathService is used to verify the installation and running status of the multipath service.

Types

type MountParam

type MountParam struct {
	DashT string
	DashO string
}

MountParam is the parameters for mount

Directories

Path Synopsis
Package lock provide Lock and Unlock when manage the disk
Package lock provide Lock and Unlock when manage the disk
Package models provides common models for connector
Package models provides common models for connector

Jump to

Keyboard shortcuts

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