util

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package util is a generated GoMock package.

Package util is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyNetworkInterfaces  = errors.New("could not find network interfaces")
	ErrGetNetworkInterfaces    = errors.New("failed to get network interfaces")
	ErrInvalidNetworkInterface = errors.New("could not find network interfaces with a valid MAC address")
	ErrSlicesLengthMismatch    = errors.New("slices have different lengths")
)

Functions

func IfEmpty

func IfEmpty(value, fallback string) string

Types

type Machine

type Machine interface {
	MacAddress() (string, error)
	HomeDirectory() string
	ReadPassword(fd int) ([]byte, error)
}

func NewMachine

func NewMachine(args MachineArgs) Machine

type MachineArgs

type MachineArgs struct {
	OperatingSystem OperatingSystem
}

type MockMachine

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

MockMachine is a mock of Machine interface.

func NewMockMachine

func NewMockMachine(ctrl *gomock.Controller) *MockMachine

NewMockMachine creates a new mock instance.

func (*MockMachine) EXPECT

func (m *MockMachine) EXPECT() *MockMachineMockRecorder

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

func (*MockMachine) HomeDirectory

func (m *MockMachine) HomeDirectory() string

HomeDirectory mocks base method.

func (*MockMachine) MacAddress

func (m *MockMachine) MacAddress() (string, error)

MacAddress mocks base method.

func (*MockMachine) ReadPassword

func (m *MockMachine) ReadPassword(fd int) ([]byte, error)

ReadPassword mocks base method.

type MockMachineMockRecorder

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

MockMachineMockRecorder is the mock recorder for MockMachine.

func (*MockMachineMockRecorder) HomeDirectory

func (mr *MockMachineMockRecorder) HomeDirectory() *gomock.Call

HomeDirectory indicates an expected call of HomeDirectory.

func (*MockMachineMockRecorder) MacAddress

func (mr *MockMachineMockRecorder) MacAddress() *gomock.Call

MacAddress indicates an expected call of MacAddress.

func (*MockMachineMockRecorder) ReadPassword

func (mr *MockMachineMockRecorder) ReadPassword(fd interface{}) *gomock.Call

ReadPassword indicates an expected call of ReadPassword.

type MockOperatingSystem

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

MockOperatingSystem is a mock of OperatingSystem interface.

func NewMockOperatingSystem

func NewMockOperatingSystem(ctrl *gomock.Controller) *MockOperatingSystem

NewMockOperatingSystem creates a new mock instance.

func (*MockOperatingSystem) EXPECT

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

func (*MockOperatingSystem) Getenv

func (m *MockOperatingSystem) Getenv(key string) string

Getenv mocks base method.

func (*MockOperatingSystem) Getwd

func (m *MockOperatingSystem) Getwd() (string, error)

Getwd mocks base method.

func (*MockOperatingSystem) IsNotExist

func (m *MockOperatingSystem) IsNotExist(err error) bool

IsNotExist mocks base method.

func (*MockOperatingSystem) MkdirAll

func (m *MockOperatingSystem) MkdirAll(path string, perm os.FileMode) error

MkdirAll mocks base method.

func (*MockOperatingSystem) OpenFile

func (m *MockOperatingSystem) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

OpenFile mocks base method.

func (*MockOperatingSystem) Remove

func (m *MockOperatingSystem) Remove(name string) error

Remove mocks base method.

func (*MockOperatingSystem) Stat

func (m *MockOperatingSystem) Stat(name string) (os.FileInfo, error)

Stat mocks base method.

type MockOperatingSystemMockRecorder

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

MockOperatingSystemMockRecorder is the mock recorder for MockOperatingSystem.

func (*MockOperatingSystemMockRecorder) Getenv

func (mr *MockOperatingSystemMockRecorder) Getenv(key interface{}) *gomock.Call

Getenv indicates an expected call of Getenv.

func (*MockOperatingSystemMockRecorder) Getwd

Getwd indicates an expected call of Getwd.

func (*MockOperatingSystemMockRecorder) IsNotExist

func (mr *MockOperatingSystemMockRecorder) IsNotExist(err interface{}) *gomock.Call

IsNotExist indicates an expected call of IsNotExist.

func (*MockOperatingSystemMockRecorder) MkdirAll

func (mr *MockOperatingSystemMockRecorder) MkdirAll(path, perm interface{}) *gomock.Call

MkdirAll indicates an expected call of MkdirAll.

func (*MockOperatingSystemMockRecorder) OpenFile

func (mr *MockOperatingSystemMockRecorder) OpenFile(name, flag, perm interface{}) *gomock.Call

OpenFile indicates an expected call of OpenFile.

func (*MockOperatingSystemMockRecorder) Remove

func (mr *MockOperatingSystemMockRecorder) Remove(name interface{}) *gomock.Call

Remove indicates an expected call of Remove.

func (*MockOperatingSystemMockRecorder) Stat

func (mr *MockOperatingSystemMockRecorder) Stat(name interface{}) *gomock.Call

Stat indicates an expected call of Stat.

type OperatingSystem

type OperatingSystem interface {
	Getenv(key string) string
	Stat(name string) (os.FileInfo, error)
	Getwd() (string, error)
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	Remove(name string) error
	IsNotExist(err error) bool
	MkdirAll(path string, perm os.FileMode) error
}

func NewOperatingSystem

func NewOperatingSystem() OperatingSystem

type Pair

type Pair[T, U any] struct {
	First  T
	Second U
}

func Zip

func Zip[T, U any](ts []T, us []U) ([]Pair[T, U], error)

Jump to

Keyboard shortcuts

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