34 lines
572 B
Go
34 lines
572 B
Go
package feta
|
|
|
|
import "time"
|
|
import "github.com/rs/zerolog/log"
|
|
|
|
type tootIngester struct {
|
|
inbound chan *toot
|
|
recentlySeen []*seenTootMemo
|
|
}
|
|
|
|
type tootHash string
|
|
|
|
type seenTootMemo struct {
|
|
lastSeen time.Time
|
|
tootHash tootHash
|
|
}
|
|
|
|
func newTootIngester() *tootIngester {
|
|
ti := new(tootIngester)
|
|
ti.inbound = make(chan *toot, 1)
|
|
return ti
|
|
}
|
|
|
|
func (ti *tootIngester) getDeliveryChannel() chan *toot {
|
|
return ti.inbound
|
|
}
|
|
|
|
func (ti *tootIngester) ingest() {
|
|
log.Info().Msg("tootIngester starting")
|
|
for {
|
|
time.Sleep(1 * time.Second) // FIXME do something
|
|
}
|
|
}
|