Add EntityStore interface

This commit is contained in:
Jan-Eric Hellenberg
2021-05-05 11:35:19 +02:00
committed by Jan-Eric Hellenberg
parent dba7160a41
commit abb1ce1bf8
10 changed files with 172 additions and 98 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"github.com/google/uuid"
"gitlab.hpi.de/codeocean/codemoon/poseidon/api/dto"
"gitlab.hpi.de/codeocean/codemoon/poseidon/store"
"sync"
)
@@ -28,15 +29,14 @@ const (
)
type Runner interface {
store.Entity
// SetStatus sets the status of the runner.
SetStatus(Status)
// Status gets the status of the runner.
Status() Status
// Id returns the id of the runner.
Id() string
// Execution looks up an ExecutionId for the runner and returns the associated RunnerRequest.
// If this request does not exit, ok is false, else true.
Execution(ExecutionId) (request dto.ExecutionRequest, ok bool)