library

package
v1.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCacheDirectory added in v1.10.0

func GetCacheDirectory(
	datastoreName, itemName, profileID, contentVersion string) string

GetCacheDirectory returns the cache directory for a library item based on its name, version, and intended storage profile.

func GetCachedFileName added in v1.10.0

func GetCachedFileName(fileName string) string

GetCachedFileName returns the first 17 characters of a SHA-1 sum of a file name and extension, ex. my-disk.vmdk or my-firmware.nvram.

Types

type CacheStorageURIsClient

type CacheStorageURIsClient interface {
	DatastoreFileExists(
		ctx context.Context,
		name string,
		datacenter *object.Datacenter) error

	CopyVirtualDisk(
		ctx context.Context,
		srcName string, srcDatacenter *object.Datacenter,
		dstName string, dstDatacenter *object.Datacenter,
		dstSpec vimtypes.BaseVirtualDiskSpec, force bool) (*object.Task, error)

	CopyDatastoreFile(
		ctx context.Context,
		srcName string, srcDatacenter *object.Datacenter,
		dstName string, dstDatacenter *object.Datacenter,
		force bool) (*object.Task, error)

	MakeDirectory(
		ctx context.Context,
		name string,
		datacenter *object.Datacenter,
		createParentDirectories bool) error

	WaitForTask(ctx context.Context, task *object.Task) error
}

CacheStorageURIsClient implements the client methods used by the CacheStorageURIs method.

type CachedFile added in v1.10.0

type CachedFile struct {
	Path    string
	VDiskID string
}

CachedFile refers to file that has been cached.

func CacheStorageURIs

func CacheStorageURIs(
	ctx context.Context,
	client CacheStorageURIsClient,
	dstDatacenter, srcDatacenter *object.Datacenter,
	srcFiles ...SourceFile) ([]CachedFile, error)

CacheStorageURIs copies the file(s) from srcFiles to dstDir and returns the information about the copied file(s).

type SourceFile added in v1.10.0

type SourceFile struct {
	Path    string
	VDiskID string

	DstDir                string
	DstProfileID          string
	DstDiskFormat         vimtypes.DatastoreSectorFormat
	IsDstProfileEncrypted bool
}

SourceFile refers to a file that is to be copied, including information about what the destination file.

Jump to

Keyboard shortcuts

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