utils

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountIdToAddress added in v1.3.0

func AccountIdToAddress(id types.AccountID) string

将types.AccountId 转换为 string 类型的地址

func AddVirtualMachineHardDiskDrive added in v1.1.0

func AddVirtualMachineHardDiskDrive(vmName string, vhdRoot string, vhdName string, vhdSizeBytes int64, controllerType string) error

func AddressToPublicKey added in v1.3.0

func AddressToPublicKey(address string) ([]byte, error)

将区块链帐号转成公钥

func CheckFileExists added in v1.3.0

func CheckFileExists(filePath string) bool

func CloneVirtualMachine added in v1.1.0

func CloneVirtualMachine(cloneFromVmxcPath string, cloneFromVmName string, cloneFromSnapshotName string, cloneAllSnapshots bool, vmName string, path string, harddrivePath string, ram int64, switchName string) error

func CompactDisks added in v1.1.0

func CompactDisks(expPath string, vhdDir string) error

func ConnectVirtualMachineNetworkAdapterToSwitch added in v1.1.0

func ConnectVirtualMachineNetworkAdapterToSwitch(vmName string, switchName string) error

func Contains

func Contains(s []string, e string) bool

func Copy added in v1.1.0

func Copy(src, dst string) (int64, error)

func CopyExportedVirtualMachine added in v1.1.0

func CopyExportedVirtualMachine(expPath string, outputPath string, vhdDir string, vmDir string) error

func CopyVmxcVirtualMachine added in v1.1.0

func CopyVmxcVirtualMachine(exportPath string, cloneFromVmxcPath string) error

func CreateDvdDrive added in v1.1.0

func CreateDvdDrive(vmName string, isoPath string, generation uint) (uint, uint, error)

func CreateExternalVirtualSwitch added in v1.1.0

func CreateExternalVirtualSwitch(vmName string, switchName string) error

func CreateVirtualMachine added in v1.1.0

func CreateVirtualMachine(vmName string, path string, harddrivePath string, vhdRoot string, ram int64, diskSize int64, switchName string, generation uint, diffDisks bool) error

func CreateVirtualSwitch added in v1.1.0

func CreateVirtualSwitch(switchName string, switchType string) (bool, error)

func DeleteAllDvdDrives added in v1.1.0

func DeleteAllDvdDrives(vmName string) error

func DeleteDvdDrive added in v1.1.0

func DeleteDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error

func DeleteVirtualMachine added in v1.1.0

func DeleteVirtualMachine(vmName string) error

func DeleteVirtualSwitch added in v1.1.0

func DeleteVirtualSwitch(switchName string) error

func DisableAutomaticCheckpoints added in v1.1.0

func DisableAutomaticCheckpoints(vmName string) error

func Download

func Download(fullURLFile string, destPath string) error

func EnableVirtualMachineIntegrationService added in v1.1.0

func EnableVirtualMachineIntegrationService(vmName string, integrationServiceName string) error

func ExportVirtualMachine added in v1.1.0

func ExportVirtualMachine(vmName string, path string) error

func ExportVmxcVirtualMachine added in v1.1.0

func ExportVmxcVirtualMachine(exportPath string, vmName string, snapshotName string, allSnapshots bool) error

func GetARP added in v1.1.0

func GetARP() (string, error)

func GetCpuModel

func GetCpuModel() string

GetCpuModel get cpu model

func GetDefaultVirtualSwitch added in v1.1.0

func GetDefaultVirtualSwitch() (string, error)

func GetExternalOnlineVirtualSwitch added in v1.1.0

func GetExternalOnlineVirtualSwitch() (string, error)

func GetHostAdapterIpAddressForSwitch added in v1.1.0

func GetHostAdapterIpAddressForSwitch(switchName string) (string, error)

func GetRandomString

func GetRandomString(length int) string

func GetVirtualMachineGeneration added in v1.1.0

func GetVirtualMachineGeneration(vmName string) (uint, error)

func GetVirtualMachineNetworkAdapterAddress added in v1.1.0

func GetVirtualMachineNetworkAdapterAddress(vmName string) (string, error)

func GetVirtualMachineSwitchName added in v1.1.0

func GetVirtualMachineSwitchName(vmName string) (string, error)

func GetVmIpAddress added in v1.1.0

func GetVmIpAddress(vmName string) (string, error)

func GetVmMac added in v1.1.0

func GetVmMac(vmName string) (string, error)

func ImportVmxcVirtualMachine added in v1.1.0

func ImportVmxcVirtualMachine(importPath string, vmName string, harddrivePath string, ram int64, switchName string) error

func IndexOf

func IndexOf(slice []string, e string) int

func IpAddress added in v1.1.0

func IpAddress(mac string) (string, error)

func IsOff added in v1.1.0

func IsOff(vmName string) (bool, error)

func IsRunning added in v1.1.0

func IsRunning(vmName string) (bool, error)

func Mac added in v1.1.0

func Mac(vmName string) (string, error)

func MountDvdDrive added in v1.1.0

func MountDvdDrive(vmName string, path string, controllerNumber uint, controllerLocation uint) error

func MountFloppyDrive added in v1.1.0

func MountFloppyDrive(vmName string, path string) error

func RandomPort

func RandomPort() int

func RandomSeed added in v1.3.0

func RandomSeed() (string, signature.KeyringPair)

RandomSeed 生成随机链账户种子

func Remove

func Remove(slice []string, e string) []string

func RemoveIndex

func RemoveIndex(slice []string, s int) []string

func RestartVirtualMachine added in v1.1.0

func RestartVirtualMachine(vmName string) error

func SetBootDvdDrive added in v1.1.0

func SetBootDvdDrive(vmName string, controllerNumber uint, controllerLocation uint, generation uint) error

func SetNetworkAdapterVlanId added in v1.1.0

func SetNetworkAdapterVlanId(switchName string, vlanId string) error

func SetVirtualMachineCpuCount added in v1.1.0

func SetVirtualMachineCpuCount(vmName string, cpu uint) error

func SetVirtualMachineDynamicMemory added in v1.1.0

func SetVirtualMachineDynamicMemory(vmName string, enableDynamicMemory bool) error

func SetVirtualMachineMacSpoofing added in v1.1.0

func SetVirtualMachineMacSpoofing(vmName string, enableMacSpoofing bool) error

func SetVirtualMachineSecureBoot added in v1.1.0

func SetVirtualMachineSecureBoot(vmName string, enableSecureBoot bool) error

func SetVirtualMachineVirtualizationExtensions added in v1.1.0

func SetVirtualMachineVirtualizationExtensions(vmName string, enableVirtualizationExtensions bool) error

func SetVirtualMachineVlanId added in v1.1.0

func SetVirtualMachineVlanId(vmName string, vlanId string) error

func ShutDown added in v1.1.0

func ShutDown(vmName string) error

func StartVirtualMachine added in v1.1.0

func StartVirtualMachine(vmName string) error

func StopVirtualMachine added in v1.1.0

func StopVirtualMachine(vmName string) error

func TurnOff added in v1.1.0

func TurnOff(vmName string) error

func TypeScanCodes added in v1.1.0

func TypeScanCodes(vmName string, scanCodes string) error

func UnTar

func UnTar(src io.Reader, dst string) error

func UnZip

func UnZip(src string, dst string) ([]string, error)

unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

func UnmountDvdDrive added in v1.1.0

func UnmountDvdDrive(vmName string, controllerNumber uint, controllerLocation uint) error

func UnmountFloppyDrive added in v1.1.0

func UnmountFloppyDrive(vmName string) error

func UntagVirtualMachineNetworkAdapterVlan added in v1.1.0

func UntagVirtualMachineNetworkAdapterVlan(vmName string, switchName string) error

func Uptime added in v1.1.0

func Uptime(vmName string) (uint64, error)

Types

type TimerService added in v1.1.0

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

func NewTimerService added in v1.1.0

func NewTimerService() *TimerService

func (*TimerService) GetTicker added in v1.1.0

func (s *TimerService) GetTicker(id uint64) *time.Ticker

func (*TimerService) GetTimer added in v1.1.0

func (s *TimerService) GetTimer(id uint64) *time.Timer

func (*TimerService) SubTicker added in v1.1.0

func (s *TimerService) SubTicker(id uint64, ticker *time.Ticker)

func (*TimerService) SubTimer added in v1.1.0

func (s *TimerService) SubTimer(id uint64, timer *time.Timer)

func (*TimerService) UnSubTicker added in v1.1.0

func (s *TimerService) UnSubTicker(id uint64)

func (*TimerService) UnSubTimer added in v1.1.0

func (s *TimerService) UnSubTimer(id uint64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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