Documentation
¶
Index ¶
- Variables
- type AuthPlugin
- type IDGenerator
- type IDGeneratorFactory
- type JCStore
- type JLStore
- type JRClient
- func (c *JRClient) NewJobChain(baseURL string, jc proto.JobChain) (*url.URL, error)
- func (c *JRClient) ResumeJobChain(baseURL string, sjc proto.SuspendedJobChain) (*url.URL, error)
- func (c *JRClient) Running(baseURL string, f proto.StatusFilter) ([]proto.JobStatus, error)
- func (c *JRClient) StartRequest(baseURL string, requestId string) error
- func (c *JRClient) StopRequest(baseURL string, requestId string) error
- type JRStatus
- type Job
- func (j *Job) Create(jobArgs map[string]interface{}) error
- func (j *Job) Deserialize(jobArgs []byte) error
- func (j *Job) Id() job.Id
- func (j *Job) Run(jobData map[string]interface{}) (job.Return, error)
- func (j *Job) Serialize() ([]byte, error)
- func (j *Job) Status() string
- func (j *Job) Stop() error
- type JobFactory
- type JobReaper
- type RMClient
- func (c *RMClient) CreateJL(requestId string, jl proto.JobLog) error
- func (c *RMClient) CreateRequest(requestId string, args map[string]interface{}) (string, error)
- func (c *RMClient) FindRequests(filter proto.RequestFilter) ([]proto.Request, error)
- func (c *RMClient) FinishRequest(fr proto.FinishRequest) error
- func (c *RMClient) GetJL(requestId string) ([]proto.JobLog, error)
- func (c *RMClient) GetJobChain(requestId string) (proto.JobChain, error)
- func (c *RMClient) GetRequest(requestId string) (proto.Request, error)
- func (c *RMClient) RequestList() ([]proto.RequestSpec, error)
- func (c *RMClient) Running(f proto.StatusFilter) (proto.RunningStatus, error)
- func (c *RMClient) StartRequest(requestId string) error
- func (c *RMClient) StopRequest(requestId string) error
- func (c *RMClient) SuspendRequest(requestId string, sjc proto.SuspendedJobChain) error
- func (c *RMClient) UpdateProgress(prg proto.RequestProgress) error
- type RMStatus
- type ReaperFactory
- type RequestManager
- func (r *RequestManager) Create(reqParams proto.CreateRequest) (proto.Request, error)
- func (r *RequestManager) FailPending(reqId string) error
- func (r *RequestManager) Find(filter proto.RequestFilter) ([]proto.Request, error)
- func (r *RequestManager) Finish(reqId string, finishParams proto.FinishRequest) error
- func (r *RequestManager) Get(reqId string) (proto.Request, error)
- func (r *RequestManager) GetWithJC(reqId string) (proto.Request, error)
- func (r *RequestManager) JobChain(reqId string) (proto.JobChain, error)
- func (r *RequestManager) Specs() []proto.RequestSpec
- func (r *RequestManager) Start(reqId string) error
- func (r *RequestManager) Stop(reqId string) error
- type RequestResumer
- type Runner
- type RunnerFactory
- type RunnerRepo
- type Traverser
- type TraverserFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequestManager = errors.New("forced error in request manager") ErrRequestResumer = errors.New("forced error in request resumer") )
View Source
var (
ErrIdGenerator = errors.New("forced error in id generator")
)
View Source
var (
ErrJCStore = errors.New("forced error in jobchain store")
)
View Source
var (
ErrJLStore = errors.New("forced error in joblog store")
)
View Source
var (
ErrJRClient = errors.New("forced error in jr client")
)
View Source
var (
ErrJob = errors.New("forced error in job")
)
View Source
var (
ErrJobReaper = errors.New("forced error in job reaper")
)
View Source
var (
ErrRMClient = errors.New("forced error in rm client")
)
View Source
var (
ErrRunner = errors.New("forced error in runner")
)
View Source
var (
ErrTraverser = errors.New("forced error in traverser")
)
Functions ¶
This section is empty.
Types ¶
type AuthPlugin ¶
type AuthPlugin struct {
AuthenticateFunc func(*http.Request) (auth.Caller, error)
AuthorizeFunc func(c auth.Caller, op string, req proto.Request) error
}
func (AuthPlugin) Authenticate ¶
type IDGenerator ¶
func (IDGenerator) ID ¶
func (g IDGenerator) ID() string
func (IDGenerator) UID ¶
func (g IDGenerator) UID() (string, error)
type IDGeneratorFactory ¶
func (IDGeneratorFactory) Make ¶
func (f IDGeneratorFactory) Make() id.Generator
type JLStore ¶
type JLStore struct {
CreateFunc func(string, proto.JobLog) (proto.JobLog, error)
GetFunc func(string, string) (proto.JobLog, error)
GetFullFunc func(string) ([]proto.JobLog, error)
}
type JRClient ¶
type JRClient struct {
NewJobChainFunc func(string, proto.JobChain) (*url.URL, error)
ResumeJobChainFunc func(string, proto.SuspendedJobChain) (*url.URL, error)
StartRequestFunc func(string, string) error
StopRequestFunc func(string, string) error
RunningFunc func(string, proto.StatusFilter) ([]proto.JobStatus, error)
}
func (*JRClient) NewJobChain ¶
func (*JRClient) ResumeJobChain ¶
func (*JRClient) StartRequest ¶
type JRStatus ¶
type JRStatus struct {
RunningFunc func(proto.StatusFilter) ([]proto.JobStatus, error)
}
type Job ¶
type Job struct {
CreateErr error
SerializeBytes []byte
SerializeErr error
DeserializeErr error
RunReturn job.Return
RunErr error
RunFunc func(jobData map[string]interface{}) (job.Return, error) // can use this instead of RunErr and RunFunc for more involved mocks
StopFunc func() error
StopErr error
StatusResp string
CreatedWithArgs map[string]interface{}
SetJobArgs map[string]interface{}
IdResp job.Id
}
func (*Job) Deserialize ¶
type JobFactory ¶
type RMClient ¶
type RMClient struct {
CreateRequestFunc func(string, map[string]interface{}) (string, error)
GetRequestFunc func(string) (proto.Request, error)
FindRequestsFunc func(proto.RequestFilter) ([]proto.Request, error)
StartRequestFunc func(string) error
FinishRequestFunc func(proto.FinishRequest) error
StopRequestFunc func(string) error
SuspendRequestFunc func(string, proto.SuspendedJobChain) error
GetJobChainFunc func(string) (proto.JobChain, error)
GetJLFunc func(string) ([]proto.JobLog, error)
CreateJLFunc func(string, proto.JobLog) error
RunningFunc func(proto.StatusFilter) (proto.RunningStatus, error)
RequestListFunc func() ([]proto.RequestSpec, error)
UpdateProgressFunc func(proto.RequestProgress) error
}
func (*RMClient) CreateRequest ¶
func (*RMClient) FindRequests ¶
func (*RMClient) FinishRequest ¶
func (c *RMClient) FinishRequest(fr proto.FinishRequest) error
func (*RMClient) GetJobChain ¶
func (*RMClient) GetRequest ¶
func (*RMClient) RequestList ¶
func (c *RMClient) RequestList() ([]proto.RequestSpec, error)
func (*RMClient) Running ¶
func (c *RMClient) Running(f proto.StatusFilter) (proto.RunningStatus, error)
func (*RMClient) StartRequest ¶
func (*RMClient) StopRequest ¶
func (*RMClient) SuspendRequest ¶
func (c *RMClient) SuspendRequest(requestId string, sjc proto.SuspendedJobChain) error
func (*RMClient) UpdateProgress ¶
func (c *RMClient) UpdateProgress(prg proto.RequestProgress) error
type RMStatus ¶
type RMStatus struct {
RunningFunc func(proto.StatusFilter) (proto.RunningStatus, error)
UpdateProgressFunc func(proto.RequestProgress) error
}
func (*RMStatus) Running ¶
func (s *RMStatus) Running(f proto.StatusFilter) (proto.RunningStatus, error)
func (*RMStatus) UpdateProgress ¶
func (s *RMStatus) UpdateProgress(prg proto.RequestProgress) error
type ReaperFactory ¶
type ReaperFactory struct {
RunFunc func()
StopFunc func()
FinalizeFunc func()
}
func (*ReaperFactory) Make ¶
func (rf *ReaperFactory) Make() chain.JobReaper
func (*ReaperFactory) MakeRunning ¶
func (rf *ReaperFactory) MakeRunning() chain.JobReaper
func (*ReaperFactory) MakeStopped ¶
func (rf *ReaperFactory) MakeStopped() chain.JobReaper
func (*ReaperFactory) MakeSuspended ¶
func (rf *ReaperFactory) MakeSuspended() chain.JobReaper
type RequestManager ¶
type RequestManager struct {
CreateFunc func(proto.CreateRequest) (proto.Request, error)
GetFunc func(string) (proto.Request, error)
GetWithJCFunc func(string) (proto.Request, error)
StartFunc func(string) error
StopFunc func(string) error
FinishFunc func(string, proto.FinishRequest) error
FailPendingFunc func(string) error
SpecsFunc func() []proto.RequestSpec
JobChainFunc func(string) (proto.JobChain, error)
FindFunc func(proto.RequestFilter) ([]proto.Request, error)
}
func (*RequestManager) Create ¶
func (r *RequestManager) Create(reqParams proto.CreateRequest) (proto.Request, error)
func (*RequestManager) FailPending ¶
func (r *RequestManager) FailPending(reqId string) error
func (*RequestManager) Find ¶
func (r *RequestManager) Find(filter proto.RequestFilter) ([]proto.Request, error)
func (*RequestManager) Finish ¶
func (r *RequestManager) Finish(reqId string, finishParams proto.FinishRequest) error
func (*RequestManager) GetWithJC ¶
func (r *RequestManager) GetWithJC(reqId string) (proto.Request, error)
func (*RequestManager) JobChain ¶
func (r *RequestManager) JobChain(reqId string) (proto.JobChain, error)
func (*RequestManager) Specs ¶
func (r *RequestManager) Specs() []proto.RequestSpec
func (*RequestManager) Start ¶
func (r *RequestManager) Start(reqId string) error
func (*RequestManager) Stop ¶
func (r *RequestManager) Stop(reqId string) error
type RequestResumer ¶
type RequestResumer struct {
ResumeAllFunc func()
CleanupFunc func()
ResumeFunc func(string) error
SuspendFunc func(proto.SuspendedJobChain) error
}
func (*RequestResumer) Cleanup ¶
func (r *RequestResumer) Cleanup()
func (*RequestResumer) Resume ¶
func (r *RequestResumer) Resume(id string) error
func (*RequestResumer) ResumeAll ¶
func (r *RequestResumer) ResumeAll()
func (*RequestResumer) Suspend ¶
func (r *RequestResumer) Suspend(sjc proto.SuspendedJobChain) error
type Runner ¶
type Runner struct {
RunReturn runner.Return
RunErr error
RunFunc func(jobData map[string]interface{}) byte // can use this instead of RunErr and RunFunc for more involved mocks
AddedJobData map[string]interface{} // Data to add to jobData.
RunWg *sync.WaitGroup // WaitGroup that gets released from when a runner starts running.
RunBlock chan struct{} // Channel that runner.Run() will block on, if defined.
IgnoreStop bool // false: return immediately after Stop, true: keep running after Stop
StatusResp runner.Status
// contains filtered or unexported fields
}
type RunnerFactory ¶
type RunnerRepo ¶
type RunnerRepo struct {
SetFunc func(jobId string, runner runner.Runner)
GetFunc func(jobId string) runner.Runner
RemoveFunc func(jobId string)
ItemsFunc func() (map[string]runner.Runner, error)
CountFunc func() int
}
func (RunnerRepo) Count ¶
func (r RunnerRepo) Count() int
func (RunnerRepo) Remove ¶
func (r RunnerRepo) Remove(jobId string)
type TraverserFactory ¶
type TraverserFactory struct {
MakeFunc func(*proto.JobChain) (chain.Traverser, error)
MakeFromSJCFunc func(*proto.SuspendedJobChain) (chain.Traverser, error)
}
func (*TraverserFactory) MakeFromSJC ¶
func (tf *TraverserFactory) MakeFromSJC(sjc *proto.SuspendedJobChain) (chain.Traverser, error)
Click to show internal directories.
Click to hide internal directories.