go code can read and write chunk manifest

This commit is contained in:
Chris Lu
2020-07-19 17:59:43 -07:00
parent f90d2c93c9
commit 97d97f3528
21 changed files with 511 additions and 112 deletions

View File

@@ -1,11 +1,12 @@
package needle
import (
"fmt"
"strconv"
)
const (
//stored unit types
// stored unit types
Empty byte = iota
Minute
Hour
@@ -139,3 +140,10 @@ func (t TTL) Minutes() uint32 {
}
return 0
}
func SecondsToTTL(seconds int32) string {
if seconds == 0 {
return ""
}
return fmt.Sprintf("%dm", seconds/60)
}