Documentation
¶
Overview ¶
Package http provider allows for jobs to be manualy inserted into the manager though an http api. This provider can be enabled though the config file, just as any other provider. However, the manager will not pull this provider for jobs.
Index ¶
- Constants
- Variables
- func HttpFactory() provider.Provider
- type Http
- func (h *Http) Close() error
- func (h *Http) ConfigStruct() interface{}
- func (h *Http) ConfirmJob(j job.Job) error
- func (h *Http) Init(i interface{}) error
- func (h *Http) Name() string
- func (h *Http) RequestWork(n int, c chan job.Job) error
- func (h *Http) Target() float64
- func (h *Http) WaitTime(t float64) time.Duration
- type HttpConfig
- type HttpJob
Constants ¶
View Source
const (
DEFAULT_ENDPOINT = "/job/add"
)
Variables ¶
View Source
var ( STATUS_TO_HTTP_CODE = map[job.Status]uint{ job.STATUS_SUCCESS: std_http.StatusOK, job.STATUS_FAILURE: std_http.StatusInternalServerError, } NOT_HTTP_JOB = errors.New("This job is not of the correct type. Expecting type *HttpJob") )
Functions ¶
Types ¶
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
Http is a provider that allows for manual insertion of jobs
func (*Http) ConfigStruct ¶
func (h *Http) ConfigStruct() interface{}
func (*Http) RequestWork ¶
RequestWork register a new handler function. Then hold the provider open for ever.
type HttpConfig ¶
HttpConfig provides config information for the Http provider
type HttpJob ¶
type HttpJob struct {
// contains filtered or unexported fields
}
HttpJob is a job created by the http provider
func (*HttpJob) JobConfirmer ¶
func (h *HttpJob) JobConfirmer() job.JobConfirmer
JobConfirmer return this job's provider
Click to show internal directories.
Click to hide internal directories.