job

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2014 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJob

func NewJob(cfg *JobConfig, spec *JobSpec) *job

NewJob creates a new job from the config as well as a job spec. After creating the job, calling job.Process() will actually perform the work.

Types

type JobConfig

type JobConfig struct {
	Workdir        string
	Logger         *logrus.Logger
	GitHubAPIToken string
}

JobConfig contains global configuration options for jobs

type JobSpec

type JobSpec struct {
	RepoOwner      string `json:"account"`
	RepoName       string `json:"repo"`
	GitRef         string `json:"ref"`
	GitHubAPIToken string `json:"api_token"`
	Depth          string `json:"depth"`
}

JobSpec contains the specs for a job, retrieved from parsed JSON

func NewJobSpec

func NewJobSpec(args ...interface{}) (*JobSpec, error)

NewJobSpec creates a new job spec based on the arguments that would be passed along from the job goworker picks up from Redis.

func (*JobSpec) Validate

func (spec *JobSpec) Validate() error

Validate checks that required fields are present in the spec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL