Move exporter to main and listen/interval to flags

This commit is contained in:
Johannes 'fish' Ziemke 2014-02-18 12:35:11 +01:00
commit 3ac5222f8b
9 changed files with 164 additions and 193 deletions

View file

@ -1,26 +0,0 @@
package exporter
import (
"fmt"
"log"
"strconv"
"strings"
)
func debug(name string, format string, a ...interface{}) {
if *verbose {
f := fmt.Sprintf("%s: %s", name, format)
log.Printf(f, a...)
}
}
func splitToInts(str string, sep string) (ints []int, err error) {
for _, part := range strings.Split(str, sep) {
i, err := strconv.Atoi(part)
if err != nil {
return nil, fmt.Errorf("Could not split '%s' because %s is no int: %s", str, part, err)
}
ints = append(ints, i)
}
return ints, nil
}