manifest

package
v0.1.32 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadManifest

type DownloadManifest struct {
	UUID            string           `json:"uuid"`
	Version         string           `json:"version"`
	Filename        string           `json:"filename"`
	FileHash        string           `json:"file_hash"`
	URL             string           `json:"url"`
	Etag            string           `json:"etag"`
	HashType        string           `json:"hash_type"`
	PartsDir        string           `json:"parts_dir"`
	PrefixParts     string           `json:"prefix_parts"`
	Size            int              `json:"size"`
	NumParts        int              `json:"num_parts"`
	RangeSize       int              `json:"range_size"`
	DownloadedParts []DownloadedPart `json:"downloaded_parts"`
}

Adding a new structure to represent the JSON manifest

type DownloadedPart

type DownloadedPart struct {
	PartNumber int    `json:"part_number"`
	FileHash   string `json:"file_hash"`
	Timestamp  int64  `json:"timestamp"`
	PartFile   string `json:"part_file"`
}

type Manifest

type Manifest struct {
	PartsDir    string
	PrefixParts string
	TimeStamp   int64
	Log         logger.LoggerInterface
}

func NewManifest

func NewManifest(partsDir string, prefixParts string, timestamp int64, log logger.LoggerInterface) *Manifest

func (*Manifest) DownloadManifestObject

func (m *Manifest) DownloadManifestObject(manifest DownloadManifest, fileName string, hash string) ([]byte, error)

func (*Manifest) ExtractManifestFilePathFileName

func (m *Manifest) ExtractManifestFilePathFileName(outputFile string, manifestContent []byte) (DownloadManifest, string, string, error)

func (*Manifest) ManifestPath

func (m *Manifest) ManifestPath(fileName string, hash string) (string, error)

func (*Manifest) SetLogger

func (m *Manifest) SetLogger(log logger.LoggerInterface)

Jump to

Keyboard shortcuts

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