Documentation
¶
Overview ¶
Package patroller provides functionality for iterating through unpatrolled revisions in a MediaWiki backlog.
Index ¶
- type Opts
- type Patroller
- func (p *Patroller) Comment() string
- func (p *Patroller) Diff(ctx context.Context) (string, error)
- func (p *Patroller) Err() error
- func (p *Patroller) LogAction() string
- func (p *Patroller) MarkPatrolled(ctx context.Context) error
- func (p *Patroller) Next(ctx context.Context) bool
- func (p *Patroller) RevisionID() int
- func (p *Patroller) RevisionType() string
- func (p *Patroller) Timestamp() time.Time
- func (p *Patroller) Title() string
- func (p *Patroller) URL() (string, error)
- func (p *Patroller) User() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts struct {
// If true, the patroller will start with the latest unpatrolled revision and work backwards.
// If false, it will start with the oldest unpatrolled revision and work forwards.
Latest bool
// If non-empty, the patroller will only return revisions in this namespace.
Namespace string
// If non-empty, the patroller will only return revisions made by this user.
User string
}
Opts provides the options for configuring a Patroller.
type Patroller ¶
type Patroller struct {
// contains filtered or unexported fields
}
A Patroller iterates through unpatrolled revisions in a MediaWiki backlog, provides information about each revision, and allows the caller to mark revisions as patrolled.
func (*Patroller) Comment ¶
Comment returns the comment of the revision the patroller is currently on.
func (*Patroller) Err ¶
Err returns the first non-EOF error that was encountered by the Patroller, if any.
func (*Patroller) LogAction ¶
LogAction returns the string "upload" if the current revision is a new file upload, "overwrite" if it's an upload on an existing file, or an empty string if it's a regular edit.
func (*Patroller) MarkPatrolled ¶
MarkPatrolled marks the revision the patroller is currently on as patrolled.
func (*Patroller) Next ¶
Next advances to the next unpatrolled revision in the backlog. It returns false when there are no more revisions to patrol, or if an error occurred querying the MediaWiki API. After Next returns false, the Patroller.Err method will return the first error that occurred.
func (*Patroller) RevisionID ¶
RevisionID returns the revision ID of the revision the patroller is currently on.
func (*Patroller) RevisionType ¶
RevisionType returns the type of the revision the patroller is currently on (e.g. "edit", "new", "log").
func (*Patroller) Timestamp ¶
Timestamp returns the timestamp of the revision the patroller is currently on.
func (*Patroller) Title ¶
Title returns the page title of the revision the patroller is currently on.