diff options
author | Ben Morrison <ben@gbmor.dev> | 2019-05-14 02:44:37 -0400 |
---|---|---|
committer | Ben Morrison <ben@gbmor.dev> | 2019-05-14 02:44:37 -0400 |
commit | 1281d2b6bbc797af79d6a87b082276b2049693cd (patch) | |
tree | 17cbc7e029c4dc88dc8907f2ee9101a7534e7e65 /cache/types.go | |
parent | 76ab864fd8372d947d3de97315e4f9996a39ff49 (diff) | |
download | getwtxt-1281d2b6bbc797af79d6a87b082276b2049693cd.tar.gz |
tentatively finished QueryTag and associated functions
Diffstat (limited to 'cache/types.go')
-rw-r--r-- | cache/types.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cache/types.go b/cache/types.go index 939114e..2962ab4 100644 --- a/cache/types.go +++ b/cache/types.go @@ -19,9 +19,17 @@ type Data struct { nick string date time.Time apidate []byte - status []string + status StatusMap } +// StatusMap holds the statuses posted by a given user. A standard +// time.Time value is used as the key, with the status as a string. +type StatusMap map[time.Time]string + +// StatusMapSlice is a slice of StatusMaps. Useful for sorting the +// output of queries. +type StatusMapSlice []StatusMap + // Mutex to control access to the User Index. var imutex = sync.RWMutex{} @@ -34,7 +42,8 @@ func (t TimeSlice) Len() int { return len(t) } -// Less returns true if the timestamp at index i is before the timestamp at index j in TimeSlice. +// Less returns true if the timestamp at index i is before the +// timestamp at index j in TimeSlice. // This helps satisfy sort.Interface with respect to TimeSlice. func (t TimeSlice) Less(i, j int) bool { return t[i].Before(t[j]) |