making progress, almost ready to write to disk

This commit is contained in:
2019-12-19 04:39:42 -08:00
parent 255554db97
commit d2bd99801d
16 changed files with 323 additions and 145 deletions

34
ingester/ingester.go Normal file
View File

@@ -0,0 +1,34 @@
package ingester
import "time"
import "github.com/rs/zerolog/log"
import "github.com/sneak/feta/toot"
import "github.com/sneak/feta/storage"
type TootIngester struct {
inbound chan *toot.Toot
recentlySeen []*seenTootMemo
storageBackend *storage.TootStorageBackend
}
type seenTootMemo struct {
lastSeen time.Time
tootHash toot.TootHash
}
func NewTootIngester() *TootIngester {
ti := new(TootIngester)
ti.inbound = make(chan *toot.Toot, 1)
return ti
}
func (ti *TootIngester) GetDeliveryChannel() chan *toot.Toot {
return ti.inbound
}
func (ti *TootIngester) Ingest() {
log.Info().Msg("TootIngester starting")
for {
time.Sleep(1 * time.Second) // FIXME do something
}
}