types

package
v0.0.0-...-95c80d3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataKeyHashOrig    = "hash_orig"
	MetadataKeyHashEncrypt = "hash_enc"
)
View Source
const IsoIDCloud = -1

IsoIDCloud is to flag the file is uploaded into cloud and not packed in ISO yet

Variables

This section is empty.

Functions

This section is empty.

Types

type DirInfo

type DirInfo struct {
	ID            int
	ScanRootDirID int
	NumberOfFiles int
	NumberOfDirs  int
	TotalFileSize int
	RefID         string // ID in cloud
	Path          string
	ModTime       time.Time
	CreateTime    time.Time
}

DirInfo is structure for directory

type FileInfo

type FileInfo struct {
	ID    int
	DirID int
	IsoID int
	RefID string // ID in cloud
	Name  string
	// HashLocal use hex encoding method as command line sha256sum output is hex, so as to easy compare
	HashLocal string
	// HashRemote uses base64 encoding as it is required by AWS
	HashRemote string
	Size       int
	ModTime    time.Time
}

FileInfo is structure for file

func (*FileInfo) SetHashLocal

func (fi *FileInfo) SetHashLocal(data []byte)

SetHashLocal

type ISOInfo

type ISOInfo struct {
	ID         int
	Name       string
	Region     string
	Bucket     string
	UploadKey  string
	UploadID   string
	HashLocal  string
	HashRemote string
	Size       int
	Status     IsoStatus
	CreateTime time.Time
}

ISOInfo is structure for one iso file

func (*ISOInfo) SetHashLocal

func (ii *ISOInfo) SetHashLocal(data []byte)

func (*ISOInfo) SetHashRemote

func (ii *ISOInfo) SetHashRemote(data []byte)

type IsoStatus

type IsoStatus int
const (
	IsoCreating IsoStatus = iota
	IsoCreated
	IsoUploading
	IsoUploaded
)

func (IsoStatus) String

func (s IsoStatus) String() string

type PartInfo

type PartInfo struct {
	IsoID      int
	PartNo     int
	Size       int
	Status     PartStatus
	Etag       string
	HashLocal  string
	HashRemote string
	CreateTime time.Time
}

PartInfo is struct for one upload part of one iso file

func (*PartInfo) SetHashLocal

func (pi *PartInfo) SetHashLocal(data []byte)

func (*PartInfo) SetHashRemote

func (pi *PartInfo) SetHashRemote(data []byte)

type PartStatus

type PartStatus int
const (
	PartUploading PartStatus = iota
	PartUploaded
	PartUploadFailed
)

func (PartStatus) String

func (p PartStatus) String() string

Jump to

Keyboard shortcuts

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