Documentation ¶
Overview ¶
Package file provides primitives to file indexing for sync operations.
Index ¶
Constants ¶
const INDEX_MAP_FILE_NAME = "index_map.csv"
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build is used to create a map of the current files on the local desktop. The built map will be used to compare with the IndexMap to determine whether a file needs to be downloaded or updated. The map's key format is as follows: the/ancestors/of/the/file/fileName.pdf
func CreateIndexMap ¶
CreateIndexMap writes the IndexMap to a csv file for which can be loaded for the next sync.
func LoadIndexMap ¶
func LoadIndexMap(file io.Reader) (map[string]IndexMapEntry, error)
LoadIndexMap loads the IndexMap csv file back to a map of IndexMapEntry, with the key being the file Id.
Types ¶
type IndexMap ¶
type IndexMap struct {
Entries []IndexMapEntry
}
IndexMap struct contains an array of IndexMapEntry. It is used to create a .csv IndexMap file for file comparison during syncs.
type IndexMapEntry ¶
IndexMapEntry struct contains the file Id, name and last updated (unix). These are the data used for file comparison during syncs.