processes

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConstString added in v0.0.12

func ConstString(element *ProcessElement) (bool, error)

func Evaluate added in v0.0.12

func Evaluate(element *ProcessElement) (bool, error)

func File added in v0.0.12

func File(element *ProcessElement) (bool, error)

func String added in v0.0.12

func String(element *ProcessElement) (bool, error)

Types

type Controller

type Controller interface {
	GetProcesses(c *gin.Context)
	GetProcess(c *gin.Context)
	UpdateProcess(c *gin.Context)
	ReserveProcess(c *gin.Context)
}

func NewController

func NewController(logger *zap.Logger, s Service) Controller

type DefaultController

type DefaultController struct {
	// contains filtered or unexported fields
}

func (*DefaultController) GetProcess

func (d *DefaultController) GetProcess(c *gin.Context)

func (*DefaultController) GetProcesses added in v0.0.12

func (d *DefaultController) GetProcesses(c *gin.Context)

func (*DefaultController) ReserveProcess added in v0.0.12

func (d *DefaultController) ReserveProcess(c *gin.Context)

func (*DefaultController) UpdateProcess added in v0.0.12

func (d *DefaultController) UpdateProcess(c *gin.Context)

type InitProcessGroupFn

type InitProcessGroupFn func(r *gin.RouterGroup)

func CreateInitControllersFn

func CreateInitControllersFn(jc Controller) InitProcessGroupFn

type ProcessElement added in v0.0.12

type ProcessElement struct {
	IsLocked bool
	LockedAt time.Time

	BlockId int
	Process *models.Process
	C       chan *models.Slots
}

type ProcessManager added in v0.0.12

type ProcessManager interface {
	List()
	Push(blockId int, process *models.Process) <-chan *models.Slots
	Fetch(judgementId, processId, processType string, ignoreLock bool) *ProcessElement
	Finish(element *ProcessElement, slots *models.Slots) error
	FinishWithError(element *ProcessElement, message string) error
	Reserve(element *ProcessElement) bool
}

func GetManager added in v0.0.12

func GetManager() ProcessManager

func NewManager added in v0.0.12

func NewManager(logger *zap.Logger) ProcessManager

type Service

type Service interface {
	GetProcesses(processType string) (process []*models.Process, err error)
	GetProcess(processId string) (process *models.Process, err error)
	UpdateProcess(processId, warning, error string, outputs *models.Slots) (process *models.Process, err error)
	ReserveProcess(processId string) (token string, locked bool, err error)
}

func NewService

func NewService(logger *zap.Logger, manager ProcessManager) Service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL