metadata

package
v0.0.0-...-7c30a37 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareMetaData

func CompareMetaData(remote, local *MetaData) []error

CompareMetaData compares the MetaData associated with the remote page blob and local VHD file. If both metadata are same this method returns an empty error slice else a non-empty error slice with each error describing the metadata entry that mismatched.

Types

type FileMetaData

type FileMetaData struct {
	FileName         string    `json:"fileName"`
	FileSize         int64     `json:"fileSize"`
	VHDSize          int64     `json:"vhdSize"`
	LastModifiedTime time.Time `json:"lastModifiedTime"`
	MD5Hash          []byte    `json:"md5Hash"` // Marshal will encodes []byte as a base64-encoded string
}

FileMetaData represents the metadata of a VHD file.

type MetaData

type MetaData struct {
	FileMetaData *FileMetaData `json:"fileMetaData"`
}

MetaData is the type representing metadata associated with an Azure page blob holding the VHD. This will be stored as a JSON string in the page blob metadata collection with key 'diskmetadata'.

func NewMetaDataFromLocalVHD

func NewMetaDataFromLocalVHD(vhdPath string) (*MetaData, error)

NewMetaDataFromLocalVHD creates a MetaData instance that should be associated with the page blob holding the VHD. The parameter vhdPath is the path to the local VHD.

func NewMetadataFromBlob

func NewMetadataFromBlob(blobClient storage.BlobStorageClient, containerName, blobName string) (*MetaData, error)

NewMetadataFromBlob returns MetaData instance associated with a Azure page blob, if there is no MetaData associated with the blob it returns nil value for MetaData

func (*MetaData) ToJSON

func (m *MetaData) ToJSON() (string, error)

ToJSON returns MetaData as a json string.

func (*MetaData) ToMap

func (m *MetaData) ToMap() (map[string]string, error)

ToMap returns the map representation of the MetaData which can be stored in the page blob metadata colleciton

Jump to

Keyboard shortcuts

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