Documentation ¶
Index ¶
- Constants
- Variables
- func GetConn(config map[string]interface{}) (c *github.Client, err error)
- func IsCrawlLimitReach(repojob RepoJob, appconfig map[string]interface{}) error
- func ListFromFile(logger *log.Logger, qc *cque.Client, j *cque.Job, ...) error
- func ScoreGitHubRepo(logger *log.Logger, qc *cque.Client, j *cque.Job, ...) error
- func ScoreGitHubRepoFunc(logger *log.Logger, qc *cque.Client, j *cque.Job, ...) error
- type JobFunc
- type JobFuncWrapper
- type RepoJob
- type ScoreGitHubRepoFuncResult
Constants ¶
View Source
const (
KeyListFromFile = "list_from_file"
)
View Source
const (
KeyScoreGitHubRepo = "score_githug_repo"
)
Variables ¶
View Source
var ( ErrImmediateReschedule = errors.New("reschedule ASAP") ErrDidNotReschedule = errors.New("no need to reschedule, we are done") )
Functions ¶
func IsCrawlLimitReach ¶
Check if crawl limit is reached, if it does, return a customed errorcode.
func ListFromFile ¶
Types ¶
type JobFunc ¶
type JobFunc func(logger *log.Logger, qc *que.Client, job *que.Job, appconfig map[string]interface{}) error
JobFunc should do a thing. Return either: nil => No error, move onto next job ErrImmediateReschedule => wrapper try it again immediately. ErrDidNotReschedule => wrapper will rely on queue lib to reschedule or retry. any other error => wrapper will rely on que to reschedule
type JobFuncWrapper ¶
type ScoreGitHubRepoFuncResult ¶
type ScoreGitHubRepoFuncResult struct { ID string DependedOnBy string Ownername string Name string URL string Dependencies []string DependenciesCrawlProblems []crawl.Dependencyproblem RiskNotes map[string][]string }
ScoreGitHubRepoFuncResult is the type of result that would return from our ScoreGithubRepo function.
func (*ScoreGitHubRepoFuncResult) String ¶
func (sr *ScoreGitHubRepoFuncResult) String() string
For every result type, we will need to implement String() method to satisfy our Result interface.
Click to show internal directories.
Click to hide internal directories.