]> ruderich.org/simon Gitweb - nsscash/nsscash.git/blobdiff - state.go
nsscash: store and check hash of deployed files
[nsscash/nsscash.git] / state.go
index fa8dccd60cfb56974f6a03d58eedae5c06f76b0f..9b67d9a038d14f3b5e9708c0ffd3e5ca5a9a4895 100644 (file)
--- a/state.go
+++ b/state.go
@@ -26,7 +26,9 @@ import (
 )
 
 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) {
@@ -49,6 +51,9 @@ 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
 }