disklib

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VIXDISKLIB_FLAG_OPEN_UNBUFFERED         = C.VIXDISKLIB_FLAG_OPEN_UNBUFFERED
	VIXDISKLIB_FLAG_OPEN_SINGLE_LINK        = C.VIXDISKLIB_FLAG_OPEN_SINGLE_LINK
	VIXDISKLIB_FLAG_OPEN_READ_ONLY          = C.VIXDISKLIB_FLAG_OPEN_READ_ONLY
	VIXDISKLIB_FLAG_OPEN_COMPRESSION_ZLIB   = C.VIXDISKLIB_FLAG_OPEN_COMPRESSION_ZLIB
	VIXDISKLIB_FLAG_OPEN_COMPRESSION_FASTLZ = C.VIXDISKLIB_FLAG_OPEN_COMPRESSION_FASTLZ
	VIXDISKLIB_FLAG_OPEN_COMPRESSION_SKIPZ  = C.VIXDISKLIB_FLAG_OPEN_COMPRESSION_SKIPZ
	VIXDISKLIB_FLAG_OPEN_COMPRESSION_MASK   = C.VIXDISKLIB_FLAG_OPEN_COMPRESSION_MASK
)

Flags for open

View Source
const (
	NBD    = "nbd"
	NBDSSL = "nbdssl"
	HOTADD = "hotadd"
)

Transport mode

View Source
const VIXDISKLIB_MAX_CHUNK_NUMBER = C.VIXDISKLIB_MAX_CHUNK_NUMBER
View Source
const VIXDISKLIB_MAX_CHUNK_SIZE = C.VIXDISKLIB_MAX_CHUNK_SIZE
View Source
const VIXDISKLIB_MIN_CHUNK_SIZE = C.VIXDISKLIB_MIN_CHUNK_SIZE

Chunk constants

View Source
const VIXDISKLIB_SECTOR_SIZE = C.VIXDISKLIB_SECTOR_SIZE

Sector size

View Source
const VIX_E_DISK_OUTOFRANGE = C.VIX_E_DISK_OUTOFRANGE

Error code

Variables

This section is empty.

Functions

func Connect

func Connect(appGlobal ConnectParams) (VixDiskLibConnection, VddkError)

func ConnectEx

func ConnectEx(appGlobal ConnectParams) (VixDiskLibConnection, VddkError)

func Exit

func Exit()

func GetInfo

func GetInfo(diskHandle VixDiskLibHandle) (VixDiskLibInfo, VddkError)

func GetThumbPrintForServer

func GetThumbPrintForServer(host string, port string) (string, error)

* Retrieves the "thumbprint" or "fingerprint" for a TLS server. Opens a TLS * connection to the server/port specified with security disabled, retrieves the * certificate chain and computes the thumbprint as the SHA-1 hash of the server's * certificate. For higher security uses, allow the user to specify the thumbprint * rather than automatically retrieving it.

func GetThumbPrintForURL

func GetThumbPrintForURL(url url.URL) (string, error)

func GetTransportMode

func GetTransportMode(diskHandle VixDiskLibHandle) string

func GoLogWarn

func GoLogWarn(buf *C.char)

func ListTransportModes

func ListTransportModes() string

func QueryAllocatedBlocks

func QueryAllocatedBlocks(diskHandle VixDiskLibHandle, startSector VixDiskLibSectorType, numSectors VixDiskLibSectorType, chunkSize VixDiskLibSectorType) ([]VixDiskLibBlock, VddkError)

QueryAllocatedBlocks invokes the related VDDK function.

Types

type ConnectParams

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

func NewConnectParams

func NewConnectParams(vmxSpec string, serverName string, thumbPrint string, userName string, password string,
	fcdId string, ds string, fcdssId string, cookie string, identity string, path string, flag uint32, readOnly bool, mode string) ConnectParams

type VddkError

type VddkError interface {
	Error() string
	VixErrorCode() uint64
}

func Attach

func Attach(childHandle VixDiskLibHandle, parentHandle VixDiskLibHandle) VddkError

func CheckRepair

func CheckRepair(connection VixDiskLibConnection, filename string, repair bool) VddkError

func Cleanup

func Cleanup(appGlobal ConnectParams, numCleanUp uint32, numRemaining uint32) VddkError

func Clone

func Clone(dstConnection VixDiskLibConnection, dstPath string, srcConnection VixDiskLibConnection, srcPath string,
	params VixDiskLibCreateParams, progressCallbackData string, overWrite bool) VddkError

func Close

func Close(diskHandle VixDiskLibHandle) VddkError

func Create

func Create(connection VixDiskLibConnection, path string, createParams VixDiskLibCreateParams, progressCallbackData string) VddkError

func CreateChild

func CreateChild(diskHandle VixDiskLibHandle, childPath string, diskType VixDiskLibDiskType, progressCallbackData string) VddkError

func Defragment

func Defragment(diskHandle VixDiskLibHandle, progressCallbackData string) VddkError

func Disconnect

func Disconnect(connection VixDiskLibConnection) VddkError

func EndAccess

func EndAccess(appGlobal ConnectParams) VddkError

func GetMetadataKeys

func GetMetadataKeys(diskHandle VixDiskLibHandle, buf []byte, bufLen uint, requireLen uint) VddkError

func Grow

func Grow(connection VixDiskLibConnection, path string, capacity VixDiskLibSectorType, updateGeometry bool, callbackData string) VddkError

func Init

func Init(majorVersion uint32, minorVersion uint32, dir string) VddkError

func NewVddkError

func NewVddkError(err_code uint64, err_msg string) VddkError

func PrepareForAccess

func PrepareForAccess(appGlobal ConnectParams) VddkError

func Read

func Read(diskHandle VixDiskLibHandle, startSector uint64, numSectors uint64, buf []byte) VddkError

func ReadMetadata

func ReadMetadata(diskHandle VixDiskLibHandle, key string, buf []byte, bufLen uint, requiredLen uint) VddkError

func Rename

func Rename(srcFileName string, dstFileName string) VddkError

func Shrink

func Shrink(diskHandle VixDiskLibHandle, progressCallbackData string) VddkError

func SpaceNeededForClone

func SpaceNeededForClone(srcHandle VixDiskLibHandle, diskType VixDiskLibDiskType, spaceNeeded uint64) VddkError
func Unlink(connection VixDiskLibConnection, path string) VddkError

func Write

func Write(diskHandle VixDiskLibHandle, startSector uint64, numSectors uint64, buf []byte) VddkError

func WriteMetadata

func WriteMetadata(diskHandle VixDiskLibHandle, key string, val string) VddkError

type VixDiskLibAdapterType

type VixDiskLibAdapterType int

AdapterType

const (
	VIXDISKLIB_ADAPTER_IDE           VixDiskLibAdapterType = C.VIXDISKLIB_ADAPTER_IDE
	VIXDISKLIB_ADAPTER_SCSI_BUSLOGIC VixDiskLibAdapterType = C.VIXDISKLIB_ADAPTER_SCSI_BUSLOGIC
	VIXDISKLIB_ADAPTER_SCSI_LSILOGIC VixDiskLibAdapterType = C.VIXDISKLIB_ADAPTER_SCSI_LSILOGIC
	VIXDISKLIB_ADAPTER_UNKNOWN       VixDiskLibAdapterType = C.VIXDISKLIB_ADAPTER_UNKNOWN
)

type VixDiskLibBlock

type VixDiskLibBlock C.VixDiskLibBlock

VixDiskLibBlock is the Go type for the underlying C type. Accessors are provided to dereference fields of the externally opaque C structure type.

func (VixDiskLibBlock) Length

Length returns the length of the block in sectors.

func (VixDiskLibBlock) Offset

Offset returns the offset in sectors.

func (*VixDiskLibBlock) SetLength

func (b *VixDiskLibBlock) SetLength(length VixDiskLibSectorType)

SetLength sets the length field.

func (*VixDiskLibBlock) SetOffset

func (b *VixDiskLibBlock) SetOffset(offset VixDiskLibSectorType)

SetOffset sets the offset field.

type VixDiskLibConnection

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

type VixDiskLibCreateParams

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

func NewCreateParams

func NewCreateParams(diskType VixDiskLibDiskType, adapterType VixDiskLibAdapterType, hwVersion uint16, capacity VixDiskLibSectorType) VixDiskLibCreateParams

type VixDiskLibDiskType

type VixDiskLibDiskType int

DiskType

const (
	VIXDISKLIB_DISK_MONOLITHIC_SPARSE VixDiskLibDiskType = C.VIXDISKLIB_DISK_MONOLITHIC_SPARSE // monolithic file, sparse,
	VIXDISKLIB_DISK_MONOLITHIC_FLAT   VixDiskLibDiskType = C.VIXDISKLIB_DISK_MONOLITHIC_FLAT   // monolithic file, all space pre-allocated
	VIXDISKLIB_DISK_SPLIT_SPARSE      VixDiskLibDiskType = C.VIXDISKLIB_DISK_SPLIT_SPARSE      // disk split into 2GB extents, sparse
	VIXDISKLIB_DISK_SPLIT_FLAT        VixDiskLibDiskType = C.VIXDISKLIB_DISK_SPLIT_FLAT        // disk split into 2GB extents, pre-allocated
	VIXDISKLIB_DISK_VMFS_FLAT         VixDiskLibDiskType = C.VIXDISKLIB_DISK_VMFS_FLAT         // ESX 3.0 and above flat disks
	VIXDISKLIB_DISK_STREAM_OPTIMIZED  VixDiskLibDiskType = C.VIXDISKLIB_DISK_STREAM_OPTIMIZED  // compressed monolithic sparse
	VIXDISKLIB_DISK_VMFS_THIN         VixDiskLibDiskType = C.VIXDISKLIB_DISK_VMFS_THIN         // ESX 3.0 and above thin provisioned
	VIXDISKLIB_DISK_VMFS_SPARSE       VixDiskLibDiskType = C.VIXDISKLIB_DISK_VMFS_SPARSE       // ESX 3.0 and above sparse disks
	VIXDISKLIB_DISK_UNKNOWN           VixDiskLibDiskType = C.VIXDISKLIB_DISK_UNKNOWN           // unknown type
)

type VixDiskLibGeometry

type VixDiskLibGeometry struct {
	Cylinders uint32
	Heads     uint32
	Sectors   uint32
}

type VixDiskLibHandle

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

type VixDiskLibInfo

type VixDiskLibInfo struct {
	BiosGeo            VixDiskLibGeometry
	PhysGeo            VixDiskLibGeometry
	Capacity           VixDiskLibSectorType
	AdapterType        VixDiskLibAdapterType
	NumLinks           int
	ParentFileNameHint string
	Uuid               string
}

type VixDiskLibSectorType

type VixDiskLibSectorType uint64

Jump to

Keyboard shortcuts

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