format package
This commit is contained in:
parent
2d93ddb7f3
commit
dad38143b0
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env make
|
||||
|
||||
all: ilogarchivego
|
||||
|
||||
ilogarchivego:
|
||||
go build -o iloggo src/containers.go src/archive.go
|
|
@ -30,8 +30,6 @@ var (
|
|||
cmd_split = kingpin.Command("split", "Split archives by date")
|
||||
)
|
||||
|
||||
|
||||
|
||||
type LogInfo struct {
|
||||
file os.FileInfo
|
||||
path string
|
||||
|
@ -56,8 +54,9 @@ func discover_logs(srcdir string) ([]LogInfo) {
|
|||
return logs
|
||||
}
|
||||
|
||||
var re_fname = regexp.MustCompile("((?P<network>[^_]+)_)?(?P<channel>.+)_(?P<date>[0-9]+)\\.log")
|
||||
|
||||
func parse_log_name(logname string) (LogInfo) {
|
||||
re_fname := regexp.MustCompile("((?P<network>[^_]+)_)?(?P<channel>.+)_(?P<date>[0-9]+)\\.log")
|
||||
|
||||
matches := re_fname.FindStringSubmatch(logname)
|
||||
if len(matches) != 5 { // re should match [garbage, garbage, network, channel, date]
|
||||
|
@ -163,8 +162,6 @@ func cmd_import_do(srcdir string, outdir string, impall bool) {
|
|||
wg.Wait()
|
||||
}
|
||||
|
||||
|
||||
|
||||
func cmd_inspect_do(fpath string) {
|
||||
log := &CombinedLogfile{
|
||||
fpath: fpath,
|
||||
|
@ -191,7 +188,6 @@ func cmd_inspect_do(fpath string) {
|
|||
fmt.Print(asText)
|
||||
}
|
||||
|
||||
|
||||
func main() {
|
||||
switch kingpin.Parse() {
|
||||
case "import":
|
|
@ -5,18 +5,10 @@ import (
|
|||
"os"
|
||||
"fmt"
|
||||
"bufio"
|
||||
// "strings"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
// zmq "github.com/pebbe/zmq4"
|
||||
// "strconv"
|
||||
"time"
|
||||
"sort"
|
||||
// "strings"
|
||||
// "math/rand"
|
||||
// "errors"
|
||||
// "bytes"
|
||||
// "sync"
|
||||
)
|
||||
|
||||
type errorString struct { // TODO "trivial implementation of error"
|
Loading…
Reference in New Issue