utils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNIT_GB = 1024 * 1024 * 1024
	UNIT_MB = 1024 * 1024

	ProtocolSmb     = "smb"
	ProtocolIscsi   = "iscsi"
	ProtocolNfs     = "nfs"
	ProtocolDefault = ProtocolIscsi

	AuthTypeReadWrite AuthType = "rw"
	AuthTypeReadOnly  AuthType = "ro"
	AuthTypeNoAccess  AuthType = "no"
)

Variables

This section is empty.

Functions

func BytesToMB added in v1.1.0

func BytesToMB(size int64) int64

func BytesToMBCeil added in v1.1.0

func BytesToMBCeil(size int64) int64

Ceiling

func LookupIPv4

func LookupIPv4(name string) ([]string, error)

Haven't supported IPv6 yet.

func MBToBytes added in v1.1.0

func MBToBytes(size int64) int64

func SliceContains added in v1.1.0

func SliceContains(items []string, s string) bool

func StringToBoolean

func StringToBoolean(value string) bool

func StringToSlice added in v1.1.3

func StringToSlice(value string) []string

Types

type AlreadyExistError

type AlreadyExistError string

func (AlreadyExistError) Error

func (_ AlreadyExistError) Error() string

type AuthType added in v1.1.0

type AuthType string

type BadLunTypeError

type BadLunTypeError string

func (BadLunTypeError) Error

func (_ BadLunTypeError) Error() string

type BadParametersError added in v1.1.0

type BadParametersError string

func (BadParametersError) Error added in v1.1.0

func (_ BadParametersError) Error() string

type IscsiDefaultError

type IscsiDefaultError struct {
	ErrCode int
}

func (IscsiDefaultError) Error

func (e IscsiDefaultError) Error() string

type LunReachMaxCountError

type LunReachMaxCountError string

func (LunReachMaxCountError) Error

func (_ LunReachMaxCountError) Error() string

type NoSuchLunError added in v1.1.0

type NoSuchLunError string

func (NoSuchLunError) Error added in v1.1.0

func (_ NoSuchLunError) Error() string

ISCSI errors

type NoSuchShareError added in v1.1.0

type NoSuchShareError string

func (NoSuchShareError) Error added in v1.1.0

func (_ NoSuchShareError) Error() string

Share errors

type NoSuchSnapshotError

type NoSuchSnapshotError string

func (NoSuchSnapshotError) Error

func (_ NoSuchSnapshotError) Error() string

type OutOfFreeSpaceError

type OutOfFreeSpaceError string

func (OutOfFreeSpaceError) Error

func (_ OutOfFreeSpaceError) Error() string

type ShareDefaultError added in v1.1.0

type ShareDefaultError struct {
	ErrCode int
}

func (ShareDefaultError) Error added in v1.1.0

func (e ShareDefaultError) Error() string

type ShareReachMaxCountError added in v1.1.0

type ShareReachMaxCountError string

func (ShareReachMaxCountError) Error added in v1.1.0

func (_ ShareReachMaxCountError) Error() string

type ShareSystemBusyError added in v1.1.0

type ShareSystemBusyError string

func (ShareSystemBusyError) Error added in v1.1.0

func (_ ShareSystemBusyError) Error() string

type SnapshotReachMaxCountError

type SnapshotReachMaxCountError string

func (SnapshotReachMaxCountError) Error

type TargetReachMaxCountError

type TargetReachMaxCountError string

func (TargetReachMaxCountError) Error

func (_ TargetReachMaxCountError) Error() string

Jump to

Keyboard shortcuts

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