Documentation ¶
Overview ¶
Package job implements functionality releated to Phobos jobs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelJobInput ¶
CancelJobInput includes options for canceling a job
type CancellationEvent ¶
CancellationEvent represents a job cancellation event
type CancellationSubscriptionsOptions ¶
type CancellationSubscriptionsOptions struct {
JobID string
}
CancellationSubscriptionsOptions includes options for setting up a cancellation event subscription
type ClaimJobResponse ¶
ClaimJobResponse is returned when a agent claims a Job
type GetJobsInput ¶
type GetJobsInput struct { // Sort specifies the field to sort on and direction Sort *db.JobSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // PipelineID filters the jobs by the specified pipeline. PipelineID *string // PipelineTaskPath filters the jobs by the specified pipeline task path. PipelineTaskPath *string // ProjectID filters the jobs by the specified project. ProjectID *string // AgentID filters the jobs by the specified agent ID AgentID *string // JobStatuses filters the jobs by their status. JobStatuses []models.JobStatus }
GetJobsInput is the input for querying a list of jobs
type LogStreamEventSubscriptionOptions ¶
LogStreamEventSubscriptionOptions includes options for setting up a log event subscription
type Service ¶
type Service interface { ClaimJob(ctx context.Context, agentID string) (*ClaimJobResponse, error) GetJobByPRN(ctx context.Context, prn string) (*models.Job, error) GetJobByID(ctx context.Context, jobID string) (*models.Job, error) SetJobStatus(ctx context.Context, jobID string, status models.JobStatus) (*models.Job, error) GetJobsByIDs(ctx context.Context, idList []string) ([]models.Job, error) GetJobs(ctx context.Context, input *GetJobsInput) (*db.JobsResult, error) SubscribeToCancellationEvent(ctx context.Context, options *CancellationSubscriptionsOptions) (<-chan *CancellationEvent, error) WriteLogs(ctx context.Context, jobID string, startOffset int, logs []byte) (int, error) ReadLogs(ctx context.Context, jobID string, startOffset int, limit int) ([]byte, error) SubscribeToLogStreamEvents(ctx context.Context, options *LogStreamEventSubscriptionOptions) (<-chan *logstream.LogEvent, error) GetLogStreamsByJobIDs(ctx context.Context, idList []string) ([]models.LogStream, error) SubscribeToJobs(ctx context.Context, options *SubscribeToJobsInput) (<-chan *Event, error) CancelJob(ctx context.Context, input *CancelJobInput) (*models.Job, error) }
Service implements all organization related functionality
func NewService ¶
func NewService( logger logger.Logger, dbClient *db.Client, idp *auth.IdentityProvider, logStreamManager logstream.Manager, eventManager *events.EventManager, pipelineUpdater pipeline.Updater, ) Service
NewService returns an instance of Service
type SubscribeToJobsInput ¶
SubscribeToJobsInput is the input for subscribing to jobs
Click to show internal directories.
Click to hide internal directories.