This commit is contained in:
Miek Gieben 2011-03-30 15:25:12 +02:00
parent af7f3f769f
commit 11b8cc6979
1 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ const (
// Convert a Ttl to a value. Supported values: 'm' for minutes, 'h' for hours
// 'w' for week and 'd' for days, '1d1d' is legal and returns the value of '2d'.
func StringToSeconds(ttl string) (sec uint32, ok bool) {
func stringToSeconds(ttl string) (sec uint32, ok bool) {
num := ""
for _, k := range ttl {
if unicode.IsDigit(k) {
@ -42,7 +42,7 @@ func StringToSeconds(ttl string) (sec uint32, ok bool) {
}
// Convert a value to a (string) Ttl. Reverse of StringToSeconds()
func SecondsToString(val uint32) (str string) {
func secondsToString(val uint32) (str string) {
mod := val / w
if mod > 0 {
str += strconv.Itoa(int(mod)) + "w"