// Read and write the state file used to keep data over multiple runs
-// Copyright (C) 2019 Simon Ruderich
+// Copyright (C) 2019-2020 Simon Ruderich
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
)
type State struct {
+ // Key is File.Url
LastModified map[string]time.Time
+ Checksum map[string]string // SHA512 in hex
}
func LoadState(path string) (*State, error) {
if state.LastModified == nil {
state.LastModified = make(map[string]time.Time)
}
+ if state.Checksum == nil {
+ state.Checksum = make(map[string]string)
+ }
return &state, nil
}