metadata

package
v0.0.0-...-a90d315 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 10 Imported by: 0

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 NewMetadataFromBlobMetadata

func NewMetadataFromBlobMetadata(blobmd map[string]*string) (*Metadata, error)

NewMetadataFromBlobMetadata 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 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 (*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 collection.

Jump to

Keyboard shortcuts

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