From c756f3081dcdfc500176a3c2945850727bc79c8c Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 20 Oct 2022 18:28:36 +0800 Subject: [PATCH] chore: remove /core --- core/scheduler.go | 27 --------------------------- core/status.go | 35 ----------------------------------- 2 files changed, 62 deletions(-) delete mode 100644 core/scheduler.go delete mode 100644 core/status.go diff --git a/core/scheduler.go b/core/scheduler.go deleted file mode 100644 index 966d558a94..0000000000 --- a/core/scheduler.go +++ /dev/null @@ -1,27 +0,0 @@ -package core - -import ( - "context" - "errors" - - runnerv1 "gitea.com/gitea/proto-go/runner/v1" -) - -var ErrDataLock = errors.New("Data Lock Error") - -type Filter struct { - Kind string - Type string - OS string - Arch string - Kernel string -} - -// Scheduler schedules Build stages for execution. -type Scheduler interface { - // Schedule schedules the stage for execution. - Schedule(context.Context, *runnerv1.Task) error - - // Request requests the next stage scheduled for execution. - Request(context.Context, Filter) (*runnerv1.Task, error) -} diff --git a/core/status.go b/core/status.go deleted file mode 100644 index bd1476c661..0000000000 --- a/core/status.go +++ /dev/null @@ -1,35 +0,0 @@ -package core - -// BuildStatus represents a build status -type BuildStatus string - -// enumerate all the statuses of bot build -const ( - // Build status - StatusSkipped BuildStatus = "skipped" - StatusBlocked BuildStatus = "blocked" - StatusDeclined BuildStatus = "declined" - StatusWaiting BuildStatus = "waiting_on_dependencies" - StatusPending BuildStatus = "pending" - StatusRunning BuildStatus = "running" - StatusPassing BuildStatus = "success" - StatusFailing BuildStatus = "failure" - StatusKilled BuildStatus = "killed" - StatusError BuildStatus = "error" -) - -func (status BuildStatus) IsPending() bool { - return status == StatusPending -} - -func (status BuildStatus) IsRunning() bool { - return status == StatusRunning -} - -func (status BuildStatus) IsFailed() bool { - return status == StatusFailing || status == StatusKilled || status == StatusError -} - -func (status BuildStatus) IsSuccess() bool { - return status == StatusPassing -}