Documentation ¶
Index ¶
Constants ¶
const AnonimousUserID uint32 = 0
AnonimousUserID is the UserID value assumed by revisions done by an anonimous user
Variables ¶
This section is empty.
Functions ¶
func FanOut ¶
func FanOut(ctx context.Context, in <-chan EvolvingPage, n int) (out []<-chan EvolvingPage)
FanOut creates n copies of the given EvolvingPage channel; if n < 1 panics.
func New ¶
func New(ctx context.Context, fail func(err error) error, tmpDir, lang string, restrict bool) <-chan EvolvingPage
New digest the latest wikipedia dump of the specified language into the output channel. The revision channel of each page must be exhausted (or the context cancelled), doing otherwise may result in a deadlock. The ctx and fail together should behave in the same manner as if created with WithFail - https://godoc.org/github.com/ebonetti/ctxutils#WithFail The condition restrict restricts the digest to just one dump file, used for testing purposes.
Types ¶
type EvolvingPage ¶
type EvolvingPage struct { PageID uint32 Title, Abstract string TopicID uint32 Revisions <-chan Revision }
EvolvingPage represents a wikipedia page that is being edited. Revisions is closed when there are no more revisions. Revision channel must be exhausted (or the context cancelled), doing otherwise may result in a deadlock.