util

package
v1.30.4 Latest Latest
Warning

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

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

Documentation

Overview

Package util is a generated GoMock package.

Index

Constants

View Source
const (
	GiB                  = 1024 * 1024 * 1024
	MaxPathLengthWindows = 260
)

Variables

This section is empty.

Functions

func BytesToGiB

func BytesToGiB(volumeSizeBytes int64) int64

BytesToGiB conversts Bytes to GiB

func GiBToBytes

func GiBToBytes(volumeSizeGiB int64) int64

GiBToBytes converts GiB to Bytes

func RoundUpBytes

func RoundUpBytes(volumeSizeBytes int64) int64

RoundUpBytes rounds up the volume size in bytes up to multiplications of GiB in the unit of Bytes

func RoundUpGiB

func RoundUpGiB(volumeSizeBytes int64) int64

RoundUpGiB rounds up the volume size in bytes up to multiplications of GiB in the unit of GiB

func RunPowershellCmd added in v1.28.0

func RunPowershellCmd(command string, envs ...string) ([]byte, error)

func WaitUntilTimeout added in v1.29.7

func WaitUntilTimeout(timeout time.Duration, execFunc ExecFunc, timeoutFunc TimeoutFunc) error

WaitUntilTimeout waits for the exec function to complete or return timeout error

Types

type Azcopy added in v1.29.1

type Azcopy struct {
	ExecCmd EXEC
}

func (*Azcopy) GetAzcopyJob added in v1.29.1

func (ac *Azcopy) GetAzcopyJob(dstFileshare string, authAzcopyEnv []string) (AzcopyJobState, string, error)

GetAzcopyJob get the azcopy job status if job existed

func (*Azcopy) TestListJobs added in v1.29.5

func (ac *Azcopy) TestListJobs(accountName, storageEndpointSuffix string, authAzcopyEnv []string) (string, error)

TestListJobs test azcopy jobs list command with authAzcopyEnv

type AzcopyJobState added in v1.29.1

type AzcopyJobState string
const (
	AzcopyJobError     AzcopyJobState = "Error"
	AzcopyJobNotFound  AzcopyJobState = "NotFound"
	AzcopyJobRunning   AzcopyJobState = "Running"
	AzcopyJobCompleted AzcopyJobState = "Completed"
)

type EXEC added in v1.29.1

type EXEC interface {
	RunCommand(string, []string) (string, error)
}

type ExecCommand added in v1.29.1

type ExecCommand struct {
}

func (*ExecCommand) RunCommand added in v1.29.1

func (ec *ExecCommand) RunCommand(cmdStr string, authEnv []string) (string, error)

type ExecFunc added in v1.29.7

type ExecFunc func() (err error)

ExecFunc returns a exec function's output and error

type MockEXEC added in v1.29.1

type MockEXEC struct {
	// contains filtered or unexported fields
}

MockEXEC is a mock of EXEC interface.

func NewMockEXEC added in v1.29.1

func NewMockEXEC(ctrl *gomock.Controller) *MockEXEC

NewMockEXEC creates a new mock instance.

func (*MockEXEC) EXPECT added in v1.29.1

func (m *MockEXEC) EXPECT() *MockEXECMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEXEC) RunCommand added in v1.29.1

func (m *MockEXEC) RunCommand(arg0 string, arg1 []string) (string, error)

RunCommand mocks base method.

type MockEXECMockRecorder added in v1.29.1

type MockEXECMockRecorder struct {
	// contains filtered or unexported fields
}

MockEXECMockRecorder is the mock recorder for MockEXEC.

func (*MockEXECMockRecorder) RunCommand added in v1.29.1

func (mr *MockEXECMockRecorder) RunCommand(arg0, arg1 interface{}) *gomock.Call

RunCommand indicates an expected call of RunCommand.

type TimeoutFunc added in v1.29.7

type TimeoutFunc func() (err error)

TimeoutFunc returns output and error if an ExecFunc timeout

Jump to

Keyboard shortcuts

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