GBClientWatch

package
v0.0.0-...-3040e0b Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForChanges

func CheckForChanges(previousFileMap map[string]FileData, file_added_chan, file_modified_chan, file_deleted_chan chan OutputData)

CheckForChanges detects if a file was added, modified, or deleted, and pushes the info through the channels given as input

func InitFileMap

func InitFileMap(fMap *map[string]FileData) error

InitFileMap initiates a fileMap, representing the intial state of the watched directory

Types

type FileData

type FileData struct {
	ModificationTime int64 `bson: "modificationTime"`
	IsDir            bool  `bson: "isDir"`
	Size             int64 `bson: "size"`
}

FileData is used for the values of the hash map for fileMap

type OutputData

type OutputData struct {
	Path              string `bson: "path"`
	Is_dir            bool   `bson: "is_dir"`
	Modification_time int64  `bson: "modification_time"`
	Size              int64  `bson: "size"`
}

OutputData is used as the communication of data in channels

func CheckForFilesToSendToServerOnInit

func CheckForFilesToSendToServerOnInit(last_accessed int64) ([]OutputData, error)

CheckForFilesToSendToServerOnInit returns a list of files that need to be sent to the server to be updated.

Jump to

Keyboard shortcuts

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