manager

package
v0.0.0-...-11ce7c2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2018 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHash

func CheckHash(file []byte, hash uint32) bool

CheckHash Comparing hashes of the passed file with the previous hash

func HashFile

func HashFile(file []byte) uint32

HashFile Obtaining the has of the passed file

Types

type Entity

type Entity struct {
	File string `json:"file"`
	Hash uint32 `json:"hash"`
}

Entity Data Structure for holding the file name and hash of an entity

type Manager

type Manager struct {
	FileData       string
	NewFileTimings map[string]uint32
	OldFileTimings map[string]uint32
	FileList       map[string]string
	HashJSONold    Parent
	HashJSONnew    Parent
	Logger         *lg.Logger
}

Manager Data Structure to hold and operate on details.json

func NewManager

func NewManager(log *lg.Logger) (Manager, error)

NewManager Helper function to create a new manager

func (*Manager) GenerateFileList

func (man *Manager) GenerateFileList(par ps.Parser, tag string) error

GenerateFileList Generating the files list which we are going to compile

func (*Manager) GenerateList

func (man *Manager) GenerateList() error

GenerateList Generate a brand new details.json

func (*Manager) ReadDetails

func (man *Manager) ReadDetails() error

ReadDetails Reading from the details.json file

func (*Manager) WriteDetails

func (man *Manager) WriteDetails() error

WriteDetails Writing the new data onto details.json

type Parent

type Parent struct {
	Body struct {
		Entity []Entity `json:"entity"`
	} `json:"body"`
}

Parent Data Structure to hold multiple Entity elements

Jump to

Keyboard shortcuts

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