Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ErrJobsBootstrap error when bootstrap fails. ErrJobsBootstrap = errors.Error("failed to bootstrap jobs") // ErrJobsMissing error when job doesn't exist in Repository. ErrJobsMissing = errors.Error("job doesn't exist") // ErrKeyConstructionFailed error when the key construction failed. ErrKeyConstructionFailed = errors.Error("failed to construct job key") )
View Source
const ( // Success is the success status for a job or a task Success Status = "success" // Failed is the failed status for a job or a task Failed Status = "failed" // Pending is the pending status for a job or a task Pending Status = "pending" // JobIDParam maps job ID in the kwargs. JobIDParam = "jobID" // BootstrappedRepo is the key mapped to jobs.Repository. BootstrappedRepo = "BootstrappedRepo" // BootstrappedService is the key to mapped jobs.JobManager BootstrappedService = "BootstrappedService" // JobDataTypeURL is the type of the job data JobDataTypeURL = "http://github.com/centrifuge/go-centrifuge/jobs/#Job" )
Variables ¶
This section is empty.
Functions ¶
func JobIDEqual ¶
JobIDEqual checks if given two JobIDs are equal
Types ¶
type Job ¶
type Job struct { ID JobID DID identity.DID Description string // Status is the overall status of the Job Status Status // TaskStatus tracks the status of individual tasks running in the system for this Job TaskStatus map[string]Status // Logs are Job log messages Logs []Log CreatedAt time.Time // Values retrieved from events Values map[string]JobValue }
Job contains details of Job.
type JobID ¶
type JobID uuid.UUID
JobID is a centrifuge job ID. Internally represented by a UUID. Externally visible as a byte slice or a hex encoded string.
func FromString ¶
FromString tries to convert the given hex string jobID into a type JobID
type Manager ¶
type Manager interface { // ExecuteWithinJob executes the given unit of work within a Job ExecuteWithinJob(ctx context.Context, accountID identity.DID, existingJobID JobID, desc string, work func(accountID identity.DID, jobID JobID, jobManager Manager, err chan<- error)) (jobID JobID, done chan error, err error) GetJob(accountID identity.DID, id JobID) (*Job, error) UpdateJobWithValue(accountID identity.DID, id JobID, key string, value []byte) error UpdateTaskStatus(accountID identity.DID, id JobID, status Status, taskName, message string) error GetJobStatus(accountID identity.DID, id JobID) (StatusResponse, error) WaitForJob(accountID identity.DID, txID JobID) error GetDefaultTaskTimeout() time.Duration }
Manager is a manager for centrifuge Jobs.
type Repository ¶
Repository can be implemented by a type that handles storage for Jobs.
Click to show internal directories.
Click to hide internal directories.