Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package core
import "io"
// A single collection job. Defines as an interface as there are all
// kinds of different collection jobs as the respective source
// repository is different.
type Job interface {
// Return the unique identifier of this job.
Id() JobId
// Return the current state of this job.
State() JobState
// When State is Failed, return the error that caused
// the failure. When State is not failed, this method
// always returns nil.
Error() error
// This is a synchronous operation that might take a long
// time. Instead of invoking Collect directly, you should
// create a Collector and Submit this job to it.
Collect(c *Collector) error
// Write to the log associated with this Job. The log message
// will be output with the standard logger as well as recorded
// to the buffer accessible with Job.Logs().
Log(v ...interface{})
// Write a formatted string to the log associated with this
// Job. The log message will be output with the standard
// logger as well as recorded to the buffer accessible with
// Job.Logs().
Logf(format string, v ...interface{})
// Return the log stream of this job.
Logs() io.Reader
}