Documentation ¶
Index ¶
- func LogError(err error, context ...map[string]interface{}) bool
- type APIService
- type CleanupService
- type ContainerGetter
- type ContainerService
- type JobQueue
- func (jq *JobQueue) AddJob(job *models.Job) (*JobQueueItem, error)
- func (jq *JobQueue) AddNewJob(db *gorm.DB, Type libremotebuild.JobType, uploadType libremotebuild.UploadType, ...) (*JobQueueItem, error)
- func (jq *JobQueue) FindJob(jobID uint) *JobQueueItem
- func (jq *JobQueue) GetJobQueuePos(jiq *JobQueueItem) int
- func (jq *JobQueue) GetJobs() []JobQueueItem
- func (jq *JobQueue) Load() error
- func (jq *JobQueue) RemoveJob(jobID uint)
- func (jq *JobQueue) Run()
- func (jq *JobQueue) Start()
- type JobQueueItem
- type JobService
- type SortByPosition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIService ¶
type APIService struct { HTTPServer *http.Server HTTPTLSServer *http.Server // contains filtered or unexported fields }
APIService the service handling the API
func NewAPIService ¶
func NewAPIService(config *models.Config, getRouter func() *mux.Router) *APIService
NewAPIService create new API service
type CleanupService ¶
type CleanupService struct {
// contains filtered or unexported fields
}
CleanupService cleanupservice cleansup stuff in background from DB
func NewClienupService ¶
func NewClienupService(config *models.Config, db *gorm.DB) *CleanupService
NewClienupService create a new cleanupservice
type ContainerGetter ¶
type ContainerGetter func(jobType libremotebuild.JobType) (string, error)
ContainerGetter get container for job
type ContainerService ¶
ContainerService provides management for container versions and availability
func NewContainerService ¶
func NewContainerService(config *models.Config) *ContainerService
NewContainerService create a new container Service
func (*ContainerService) GetContainer ¶
func (cs *ContainerService) GetContainer(job libremotebuild.JobType) (string, error)
GetContainer for a job
type JobQueue ¶
type JobQueue struct {
// contains filtered or unexported fields
}
JobQueue a queue for jobs
func NewJobQueue ¶
NewJobQueue create a new JobQueue
func (*JobQueue) AddJob ¶
func (jq *JobQueue) AddJob(job *models.Job) (*JobQueueItem, error)
AddJob to a jobqueue
func (*JobQueue) AddNewJob ¶
func (jq *JobQueue) AddNewJob(db *gorm.DB, Type libremotebuild.JobType, uploadType libremotebuild.UploadType, args map[string]string, useCcache bool) (*JobQueueItem, error)
AddNewJob create job and add to queue
func (*JobQueue) FindJob ¶
func (jq *JobQueue) FindJob(jobID uint) *JobQueueItem
FindJob find job in queue
func (*JobQueue) GetJobQueuePos ¶
func (jq *JobQueue) GetJobQueuePos(jiq *JobQueueItem) int
GetJobQueuePos position of job in the queue
func (*JobQueue) GetJobs ¶
func (jq *JobQueue) GetJobs() []JobQueueItem
GetJobs return jobs in queue
type JobQueueItem ¶
type JobQueueItem struct { gorm.Model JobID uint `sql:"index"` Job *models.Job `gorm:"association_autoupdate:false;association_autocreate:false"` Position uint // The position in the Queue RunningSince time.Time `gorm:"-"` Deleted bool `gorm:"-"` }
JobQueueItem Item in JobQueue
func (JobQueueItem) TableName ¶
func (jqi JobQueueItem) TableName() string
TableName use "JobQueue" as tablename
type JobService ¶
JobService managing jobs
func NewJobService ¶
func NewJobService(config *models.Config, db *gorm.DB, getContainer ContainerGetter) *JobService
NewJobService create a new jobservice
func (*JobService) GetOldJobs ¶
func (js *JobService) GetOldJobs(limit int) ([]models.Job, error)
GetOldJobs return n(limit) old jobs
func (*JobService) GetOldLogs ¶
func (js *JobService) GetOldLogs(jobID uint) (string, error)
GetOldLogs get old logs for job
type SortByPosition ¶
type SortByPosition []JobQueueItem
SortByPosition sort by JobQueueItem position
func (SortByPosition) Len ¶
func (a SortByPosition) Len() int
func (SortByPosition) Less ¶
func (a SortByPosition) Less(i, j int) bool
func (SortByPosition) Swap ¶
func (a SortByPosition) Swap(i, j int)