Documentation
¶
Index ¶
- Variables
- func NewNullString(s string) sql.NullString
- func ParseNullBool(nullBool sql.NullBool) bool
- func ParseNullFloat(nullFloat sql.NullFloat64) float64
- func ParseNullInt(nullInt sql.NullInt64) int64
- func ParseNullString(nullString sql.NullString) string
- func ParseNullTime(nullTime pq.NullTime) *time.Time
- func ParseNullTimeDefault(nullTime pq.NullTime) time.Time
- func StartsWith(field exp.IdentifierExpression, pattern string) goqu.Expression
- func ToUTC(t time.Time) time.Time
- type Clock
- type DefaultClock
- type JobRecorder
- type JobRepository
- type JobRow
- type JobState
- type SQLJobRepository
- func (r *SQLJobRepository) GetJobSetInfos(ctx context.Context, opts *lookout.GetJobSetsRequest) ([]*lookout.JobSetInfo, error)
- func (r *SQLJobRepository) GetJobs(ctx context.Context, opts *lookout.GetJobsRequest) ([]*lookout.JobInfo, error)
- func (r *SQLJobRepository) GetQueueInfos(ctx context.Context) ([]*lookout.QueueInfo, error)
- type SQLJobStore
- func (r *SQLJobStore) MarkCancelled(event *api.JobCancelledEvent) error
- func (r *SQLJobStore) RecordJob(job *api.Job) error
- func (r *SQLJobStore) RecordJobDuplicate(event *api.JobDuplicateFoundEvent) error
- func (r *SQLJobStore) RecordJobFailed(event *api.JobFailedEvent) error
- func (r *SQLJobStore) RecordJobPending(event *api.JobPendingEvent) error
- func (r *SQLJobStore) RecordJobReprioritized(event *api.JobReprioritizedEvent) error
- func (r *SQLJobStore) RecordJobRunning(event *api.JobRunningEvent) error
- func (r *SQLJobStore) RecordJobSucceeded(event *api.JobSucceededEvent) error
- func (r *SQLJobStore) RecordJobTerminated(event *api.JobTerminatedEvent) error
- func (r *SQLJobStore) RecordJobUnableToSchedule(event *api.JobUnableToScheduleEvent) error
Constants ¶
This section is empty.
Variables ¶
View Source
var AllJobStates = []JobState{ JobQueued, JobPending, JobRunning, JobSucceeded, JobFailed, JobCancelled, JobDuplicate, }
View Source
var IntToJobStateMap = map[int]JobState{ 1: JobQueued, 2: JobPending, 3: JobRunning, 4: JobSucceeded, 5: JobFailed, 6: JobCancelled, 7: JobDuplicate, }
View Source
var JobStateToIntMap = map[JobState]int{ JobQueued: 1, JobPending: 2, JobRunning: 3, JobSucceeded: 4, JobFailed: 5, JobCancelled: 6, JobDuplicate: 7, }
Functions ¶
func NewNullString ¶ added in v0.1.39
func NewNullString(s string) sql.NullString
func ParseNullBool ¶ added in v0.1.17
func ParseNullFloat ¶ added in v0.1.17
func ParseNullFloat(nullFloat sql.NullFloat64) float64
func ParseNullInt ¶ added in v0.1.21
func ParseNullString ¶ added in v0.1.17
func ParseNullString(nullString sql.NullString) string
func ParseNullTimeDefault ¶ added in v0.1.17
func StartsWith ¶ added in v0.1.29
func StartsWith(field exp.IdentifierExpression, pattern string) goqu.Expression
Types ¶
type DefaultClock ¶ added in v0.1.21
type DefaultClock struct{}
func (*DefaultClock) Now ¶ added in v0.1.21
func (c *DefaultClock) Now() time.Time
type JobRecorder ¶
type JobRecorder interface { RecordJob(job *api.Job) error MarkCancelled(*api.JobCancelledEvent) error RecordJobPending(event *api.JobPendingEvent) error RecordJobRunning(event *api.JobRunningEvent) error RecordJobSucceeded(event *api.JobSucceededEvent) error RecordJobFailed(event *api.JobFailedEvent) error RecordJobUnableToSchedule(event *api.JobUnableToScheduleEvent) error RecordJobDuplicate(event *api.JobDuplicateFoundEvent) error RecordJobTerminated(event *api.JobTerminatedEvent) error RecordJobReprioritized(event *api.JobReprioritizedEvent) error }
type JobRepository ¶
type JobRow ¶ added in v0.1.21
type JobRow struct { JobId sql.NullString `db:"job_id"` Queue sql.NullString `db:"queue"` Owner sql.NullString `db:"owner"` JobSet sql.NullString `db:"jobset"` Priority sql.NullFloat64 `db:"priority"` Submitted pq.NullTime `db:"submitted"` Cancelled pq.NullTime `db:"cancelled"` JobJson sql.NullString `db:"job"` State sql.NullInt64 `db:"state"` RunId sql.NullString `db:"run_id"` PodNumber sql.NullInt64 `db:"pod_number"` Cluster sql.NullString `db:"cluster"` Node sql.NullString `db:"node"` Created pq.NullTime `db:"created"` Started pq.NullTime `db:"started"` Finished pq.NullTime `db:"finished"` Succeeded sql.NullBool `db:"succeeded"` Error sql.NullString `db:"error"` }
type JobState ¶ added in v0.1.23
type JobState string
Emulates JobStates enum can't use protobuf enums because gogoproto + grpc-gateway is hard with K8s specific messages
type SQLJobRepository ¶
type SQLJobRepository struct {
// contains filtered or unexported fields
}
func NewSQLJobRepository ¶
func NewSQLJobRepository(db *goqu.Database, clock Clock) *SQLJobRepository
func (*SQLJobRepository) GetJobSetInfos ¶ added in v0.1.21
func (r *SQLJobRepository) GetJobSetInfos(ctx context.Context, opts *lookout.GetJobSetsRequest) ([]*lookout.JobSetInfo, error)
func (*SQLJobRepository) GetJobs ¶ added in v0.1.23
func (r *SQLJobRepository) GetJobs(ctx context.Context, opts *lookout.GetJobsRequest) ([]*lookout.JobInfo, error)
func (*SQLJobRepository) GetQueueInfos ¶ added in v0.1.21
type SQLJobStore ¶
type SQLJobStore struct {
// contains filtered or unexported fields
}
func NewSQLJobStore ¶
func NewSQLJobStore(db *goqu.Database, annotationPrefix string) *SQLJobStore
func (*SQLJobStore) MarkCancelled ¶
func (r *SQLJobStore) MarkCancelled(event *api.JobCancelledEvent) error
func (*SQLJobStore) RecordJobDuplicate ¶ added in v0.1.33
func (r *SQLJobStore) RecordJobDuplicate(event *api.JobDuplicateFoundEvent) error
func (*SQLJobStore) RecordJobFailed ¶
func (r *SQLJobStore) RecordJobFailed(event *api.JobFailedEvent) error
func (*SQLJobStore) RecordJobPending ¶
func (r *SQLJobStore) RecordJobPending(event *api.JobPendingEvent) error
func (*SQLJobStore) RecordJobReprioritized ¶ added in v0.1.39
func (r *SQLJobStore) RecordJobReprioritized(event *api.JobReprioritizedEvent) error
func (*SQLJobStore) RecordJobRunning ¶
func (r *SQLJobStore) RecordJobRunning(event *api.JobRunningEvent) error
func (*SQLJobStore) RecordJobSucceeded ¶
func (r *SQLJobStore) RecordJobSucceeded(event *api.JobSucceededEvent) error
func (*SQLJobStore) RecordJobTerminated ¶ added in v0.1.34
func (r *SQLJobStore) RecordJobTerminated(event *api.JobTerminatedEvent) error
func (*SQLJobStore) RecordJobUnableToSchedule ¶ added in v0.1.23
func (r *SQLJobStore) RecordJobUnableToSchedule(event *api.JobUnableToScheduleEvent) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.