27 lines
522 B
Go
Raw Normal View History

2019-06-03 09:32:43 +00:00
package arn
import (
"github.com/aerogo/nano"
)
// UserFollows is a list including IDs to users you follow.
type UserFollows struct {
UserID UserID `json:"userId" primary:"true"`
2019-06-03 09:32:43 +00:00
Items []string `json:"items"`
}
// StreamUserFollows returns a stream of all user follows.
func StreamUserFollows() <-chan *UserFollows {
channel := make(chan *UserFollows, nano.ChannelBufferSize)
go func() {
for obj := range DB.All("UserFollows") {
channel <- obj.(*UserFollows)
}
close(channel)
}()
return channel
}