utils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDirTable added in v0.0.3

func CreateDirTable(rows []HashResults, algo string) *tablewriter.Table

CreateDirTable returns a two column table to render

func CreateTable

func CreateTable(rows []HashResults, algo string) *tablewriter.Table

CreateTable returns a formatted table to render

func HandleOutput added in v0.0.7

func HandleOutput(op []HashResults, h string, format string, isDir bool, clearFooter bool)

HandleOutput is used to provide the output in the required format

func IsDirectory added in v0.0.3

func IsDirectory(fileName string) bool

func ReturnFilesInFolder added in v0.0.3

func ReturnFilesInFolder(folder string) []string

Types

type HashResults

type HashResults struct {
	Filename string `json:"filename"`
	Hash     string `json:"hash"`
}

HashResults store the computed hash of a filename

func GetHashesForFiles added in v0.0.7

func GetHashesForFiles(files []string, algo string) []HashResults

GetHashesForFiles returns the hashes for a given set of files

func HashesAreEqual added in v0.0.3

func HashesAreEqual(hr1 []HashResults, hr2 []HashResults) (bool, []HashResults)

type JSONHashResults added in v0.0.7

type JSONHashResults struct {
	Results []HashResults `json:"results"`
	Match   bool          `json:"matched"`
	Algo    string        `json:"algo"`
}

JSONHashResults are a json representation of the results

Jump to

Keyboard shortcuts

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