lib

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateReport

func CreateReport(w io.Writer, pathList PathList, result HashList) error

CreateReport creates html report from HashList and saves html file to io.Writer w.

Types

type HashData

type HashData struct {
	RelativePath string `json:"relative_path"`
	HashValue    string `json:"hash_value"`
	VerifyResult bool   `json:"verify_result,omitempty"`
	Reason       string `json:"reason_of_failed,omitempty"`
}

HashData is hash value and file name struct

type HashList

type HashList struct {
	List         []HashData `json:"hash_list"`
	VerifyResult bool       `json:"verify_result,omitempty"`
}

HashList is a list of HashData struct

func GetHashList

func GetHashList(source string) (HashList, error)

GetHashList returns the hash list of source. For source, a json file or a directory is supported.

func VerifyHashList added in v0.2.0

func VerifyHashList(source, target HashList, doHashCheck, doUnnecessaryCheck bool) HashList

VerifyHashList verifies hash list of source and target. Then, returns HashList that has VerifyResult.

func (*HashList) GetDirectoryInfo added in v0.6.0

func (h *HashList) GetDirectoryInfo() (int, int)

GetDirectoryInfo returns the number of directories and files. If HashList.List is nil or empty, returns 0 and 0.

type PathList added in v0.2.0

type PathList struct {
	SourcePath string
	TargetPath string
}

PathList is a list of paths

Jump to

Keyboard shortcuts

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