Documentation
¶
Index ¶
- type AssignedTasks
- type Database
- func (database *Database) AcceptAccessRequest(worker int64, projectId int64) bool
- func (database Database) BulkSaveTask(bulkSaveTaskReqs []SaveTaskRequest) []error
- func (database *Database) GetAllAccesses(projectId int64) *[]WorkerAccess
- func (database Database) GetAllProjects(managerId int64) *[]Project
- func (database *Database) GetAllWorkerStats() *[]WorkerStats
- func (database *Database) GetAssigneeStats(pid int64, count int64) *[]AssignedTasks
- func (database *Database) GetLogs(since int64, level LogLevel) *[]LogEntry
- func (database *Database) GetManagerList() *[]Manager
- func (database *Database) GetManagerListWithRoleOn(project int64) *[]ManagerRoleOn
- func (database *Database) GetManagerRoleOn(manager *Manager, projectId int64) ManagerRole
- func (database *Database) GetMonitoringSnapshotsBetween(pid int64, from int, to int) (ss *[]ProjectMonitoringSnapshot)
- func (database *Database) GetNMonitoringSnapshots(pid int64, count int) (ss *[]ProjectMonitoringSnapshot)
- func (database *Database) GetProject(id int64) *Project
- func (database *Database) GetProjectWithRepoName(repoName string) *Project
- func (database *Database) GetSecret(pid int64, workerId int64) (secret string, err error)
- func (database *Database) GetTaskFromProject(worker *Worker, projectId int64) *Task
- func (database *Database) GetWebhookSecret(pid int64) (secret string, err error)
- func (database *Database) GetWorker(id int64) *Worker
- func (database Database) HardReset(pid int64) int64
- func (database *Database) MakeProjectSnapshots()
- func (database Database) ReclaimAssignedTasks(pid int64) int64
- func (database *Database) RejectAccessRequest(workerId int64, projectId int64) bool
- func (database Database) ReleaseTask(id int64, workerId int64, result TaskResult, verification int64) bool
- func (database *Database) Reset()
- func (database *Database) ResetFailedTasks(pid int64) int64
- func (database *Database) ResetTimedOutTasks()
- func (database *Database) SaveAccessRequest(wa *WorkerAccess) bool
- func (database *Database) SaveManager(manager *Manager, password []byte) error
- func (database *Database) SaveProject(project *Project, webhookSecret string) (int64, error)
- func (database *Database) SaveTask(task *Task, project int64, hash64 int64, wid int64) error
- func (database *Database) SaveWorker(worker *Worker)
- func (database *Database) SetManagerRoleOn(manager int64, projectId int64, role ManagerRole)
- func (database *Database) SetSecret(pid int64, secret string)
- func (database *Database) SetWebhookSecret(pid int64, secret string) (err error)
- func (database *Database) SetupLoggerHook()
- func (database *Database) UpdateManager(manager *Manager)
- func (database *Database) UpdateManagerPassword(manager *Manager, newPassword []byte)
- func (database *Database) UpdateProject(project *Project) error
- func (database *Database) UpdateWorker(worker *Worker) bool
- func (database *Database) ValidateCredentials(username []byte, password []byte) (*Manager, error)
- type LogEntry
- type LogLevel
- type Manager
- type ManagerRole
- type ManagerRoleOn
- type Project
- type ProjectMonitoringSnapshot
- type SaveTaskRequest
- type Task
- type TaskResult
- type TaskStatus
- type Worker
- type WorkerAccess
- type WorkerStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssignedTasks ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) AcceptAccessRequest ¶
func (Database) BulkSaveTask ¶
func (database Database) BulkSaveTask(bulkSaveTaskReqs []SaveTaskRequest) []error
func (*Database) GetAllAccesses ¶
func (database *Database) GetAllAccesses(projectId int64) *[]WorkerAccess
func (Database) GetAllProjects ¶
func (*Database) GetAllWorkerStats ¶
func (database *Database) GetAllWorkerStats() *[]WorkerStats
func (*Database) GetAssigneeStats ¶
func (database *Database) GetAssigneeStats(pid int64, count int64) *[]AssignedTasks
func (*Database) GetManagerList ¶
func (*Database) GetManagerListWithRoleOn ¶
func (database *Database) GetManagerListWithRoleOn(project int64) *[]ManagerRoleOn
func (*Database) GetManagerRoleOn ¶
func (database *Database) GetManagerRoleOn(manager *Manager, projectId int64) ManagerRole
func (*Database) GetMonitoringSnapshotsBetween ¶
func (database *Database) GetMonitoringSnapshotsBetween(pid int64, from int, to int) (ss *[]ProjectMonitoringSnapshot)
func (*Database) GetNMonitoringSnapshots ¶
func (database *Database) GetNMonitoringSnapshots(pid int64, count int) (ss *[]ProjectMonitoringSnapshot)
func (*Database) GetProject ¶
func (*Database) GetProjectWithRepoName ¶
func (*Database) GetTaskFromProject ¶
func (*Database) GetWebhookSecret ¶
func (*Database) MakeProjectSnapshots ¶
func (database *Database) MakeProjectSnapshots()
func (Database) ReclaimAssignedTasks ¶
func (*Database) RejectAccessRequest ¶
func (Database) ReleaseTask ¶
func (*Database) ResetFailedTasks ¶
func (*Database) ResetTimedOutTasks ¶
func (database *Database) ResetTimedOutTasks()
func (*Database) SaveAccessRequest ¶
func (database *Database) SaveAccessRequest(wa *WorkerAccess) bool
func (*Database) SaveManager ¶
func (*Database) SaveProject ¶
func (*Database) SaveWorker ¶
func (*Database) SetManagerRoleOn ¶
func (database *Database) SetManagerRoleOn(manager int64, projectId int64, role ManagerRole)
func (*Database) SetWebhookSecret ¶
func (*Database) SetupLoggerHook ¶
func (database *Database) SetupLoggerHook()
func (*Database) UpdateManager ¶
func (*Database) UpdateManagerPassword ¶
func (*Database) UpdateProject ¶
func (*Database) UpdateWorker ¶
type ManagerRole ¶
type ManagerRole int
const ( RoleNone ManagerRole = 0 RoleRead ManagerRole = 1 RoleEdit ManagerRole = 2 RoleManageAccess ManagerRole = 4 RoleSecret ManagerRole = 8 RoleMaintenance ManagerRole = 16 )
type ManagerRoleOn ¶
type ManagerRoleOn struct {
Manager Manager `json:"manager"`
Role ManagerRole `json:"role"`
}
type Project ¶
type Project struct {
Id int64 `json:"id"`
Priority int64 `json:"priority"`
Name string `json:"name"`
CloneUrl string `json:"clone_url"`
GitRepo string `json:"git_repo"`
Version string `json:"version"`
Motd string `json:"motd"`
Public bool `json:"public"`
Hidden bool `json:"hidden"`
Chain int64 `json:"chain"`
Paused bool `json:"paused"`
AssignRate rate.Limit `json:"assign_rate"`
SubmitRate rate.Limit `json:"submit_rate"`
}
type ProjectMonitoringSnapshot ¶
type ProjectMonitoringSnapshot struct {
NewTaskCount int64 `json:"new_task_count"`
FailedTaskCount int64 `json:"failed_task_count"`
ClosedTaskCount int64 `json:"closed_task_count"`
WorkerAccessCount int64 `json:"worker_access_count"`
AwaitingVerificationCount int64 `json:"awaiting_verification_count"`
TimeStamp int64 `json:"time_stamp"`
}
type SaveTaskRequest ¶
type Task ¶
type Task struct {
Id int64 `json:"id"`
Priority int16 `json:"priority"`
Project *Project `json:"project"`
Assignee int64 `json:"assignee"`
Retries int16 `json:"retries"`
MaxRetries int16 `json:"max_retries"`
Status TaskStatus `json:"status"`
Recipe string `json:"recipe"`
MaxAssignTime int64 `json:"max_assign_time"`
AssignTime int64 `json:"assign_time"`
VerificationCount int16 `json:"verification_count"`
}
type TaskResult ¶
type TaskResult int
const ( TR_OK TaskResult = 0 TR_FAIL TaskResult = 1 TR_SKIP TaskResult = 2 )
type WorkerAccess ¶
Click to show internal directories.
Click to hide internal directories.