a simple url shortener in Go (check it out at qurl.org)
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

22 lignes
444 B

package main
import (
"fmt"
"git.binarythought.com/cdramey/qurl/storage"
"os"
"path"
"time"
)
func manageBackup(stor storage.Storage, dir string, interval int) {
for {
time.Sleep(time.Duration(interval) * time.Second)
fname := fmt.Sprintf("qurl-%s.backup",
time.Now().Format("20060102150405"))
err := stor.Backup(path.Join(dir, fname))
if err != nil {
fmt.Fprintf(os.Stderr, "Backup failure: %s\n", err.Error())
}
}
}