1
0
mirror of https://github.com/thebaer/tildes.git synced 2018-07-20 07:15:21 +00:00

Merge branch 'master' of github.com:thebaer/tildes

This commit is contained in:
Matt Baer 2015-03-08 13:01:24 -05:00
commit 865d4a1b0a
3 changed files with 78 additions and 73 deletions

View File

@ -1,11 +1,11 @@
package store
import (
"os"
"fmt"
"bufio"
"strings"
"fmt"
"io/ioutil"
"os"
"strings"
)
type Row struct {
@ -45,6 +45,8 @@ func WriteData(path string, data []byte) {
if err != nil {
fmt.Println(err)
}
// TODO: check for Close() errors
// https://github.com/ncw/swift/blob/master/swift.go#L170
defer f.Close()
_, err = f.Write(data)

View File

@ -1,17 +1,17 @@
package main
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
"fmt"
"time"
"flag"
"sort"
"bufio"
"strconv"
"strings"
"io/ioutil"
"text/template"
"time"
"github.com/thebaer/tildes/store"
)
@ -58,6 +58,7 @@ type table struct {
}
type By func(r1, r2 *store.Row) bool
func (by By) Sort(rows []store.Row) {
rs := &rowSorter{
rows: rows,
@ -65,10 +66,12 @@ func (by By) Sort(rows []store.Row) {
}
sort.Sort(rs)
}
type rowSorter struct {
rows []store.Row
by func(r1, r2 *store.Row) bool
}
func (r *rowSorter) Len() int {
return len(r.rows)
}

View File

@ -1,21 +1,21 @@
package main
import (
"encoding/json"
"strings"
"bufio"
"os"
"io/ioutil"
"os/exec"
"fmt"
"regexp"
"net/http"
"flag"
"time"
"text/template"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"regexp"
"strings"
"text/template"
"time"
"github.com/thebaer/geo"
"github.com/thebaer/tildes/store"