github.com/code-to-go/safepool.lib@v0.0.0-20221205180519-ee25e63c226e/model_/file.go_ (about) 1 package model 2 3 import ( 4 "time" 5 ) 6 7 // State is the current state of a file 8 type State uint32 9 10 // State bits ||Created| 11 const ( 12 LocalCreated State = 0x1 13 LocalModified State = 0x2 14 LocalDeleted State = 0x4 15 LocalRenamed State = 0x8 16 ExchangeCreated State = 0x10 17 ExchangeModified State = 0x20 18 ExchangeDeleted State = 0x40 19 ExchangeRenamed State = 0x80 20 Staged State = 0x100 21 Watched State = 0x200 22 Alternate State = 0x400 23 Conflict State = 0x800 24 ) 25 26 // File represents a file and its state both on different locations including 27 type File struct { 28 Domain string 29 Name string 30 Id uint64 31 FirstId uint64 32 Author Identity 33 ModTime time.Time 34 Hash []byte 35 State State 36 } 37 38 type LockFile struct { 39 ExpectedDuration time.Duration 40 Id uint64 41 }