raven/types.go

34 lines
495 B
Go
Raw Normal View History

2023-01-10 05:23:25 +00:00
package main
import (
"time"
)
type Config struct {
FeedFile string
FeedAscend bool
FriendsFile string
MaxPosts int64
Nick string
}
type FeedEntry struct {
Nick string
Timestamp time.Time
Post string
}
type Feed []FeedEntry
func (self Feed) Len() int {
return len(self)
}
func (self Feed) Swap(i, j int) {
self[i], self[j] = self[j], self[i]
}
func (self Feed) Less(i, j int) bool {
return self[i].Timestamp.After(self[j].Timestamp)
}