services

package
v0.0.0-...-226c3a4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type DefaultFilesService

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

func (DefaultFilesService) FetchMetaFile

func (d DefaultFilesService) FetchMetaFile(privateSpace string) (data []byte, err error)

type DefaultJudgementsService

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

func (*DefaultJudgementsService) Create

func (s *DefaultJudgementsService) Create(
	ctx context.Context, tp string, properties map[string]string, inputs [][]byte,
) (string, error)

type DefaultProblemService

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

func (*DefaultProblemService) CreateProblem

func (s *DefaultProblemService) CreateProblem(title, locale string) (*models.Page, error)

func (*DefaultProblemService) Fetch

func (s *DefaultProblemService) Fetch(ProblemID string) (*models.Problem, error)

type DefaultSubmissionService

type DefaultSubmissionService struct {
	JudgementService JudgementsService

	Repository repositories.SubmissionRepository
	// contains filtered or unexported fields
}

func (DefaultSubmissionService) Create

func (d DefaultSubmissionService) Create(submitterID uint64, problemId string, userSpace string) (s *models.Submission, err error)

func (DefaultSubmissionService) DeliverJudgement

func (d DefaultSubmissionService) DeliverJudgement(element *repositories.Process) error

func (DefaultSubmissionService) DispatchJudgement

func (d DefaultSubmissionService) DispatchJudgement(submissionId string) error

func (DefaultSubmissionService) ReturnJudgement

func (d DefaultSubmissionService) ReturnJudgement(judgementId string, outputs [][]byte) error

type FilesService

type FilesService interface {
	FetchMetaFile(privateSpace string) (data []byte, err error)
}

func NewFilesService

func NewFilesService(client proto.FilesClient) FilesService

type JudgementsService

type JudgementsService interface {
	Create(ctx context.Context, tp string, properties map[string]string, inputs [][]byte) (string, error)
}

func NewJudgementsService

func NewJudgementsService(judgementsSrv proto.JudgementsClient) JudgementsService

type ProblemsService

type ProblemsService interface {
	Fetch(ProblemID string) (*models.Problem, error)
}

func NewProblemService

func NewProblemService(problemSrv proto.ProblemsClient) ProblemsService

type SubmissionsService

type SubmissionsService interface {
	Create(submitterID uint64, problemID string, userSpace string) (s *models.Submission, err error)

	DeliverJudgement(element *repositories.Process) error
	DispatchJudgement(submissionId string) error
	ReturnJudgement(judgementId string, outputs [][]byte) error
}

func CreateSubmissionsService

func CreateSubmissionsService(cf string, sto repositories.SubmissionRepository, problemsClient protobuf_spec.ProblemsClient, filesClient protobuf_spec.FilesClient, judgementsClient protobuf_spec.JudgementsClient) (SubmissionsService, error)

func NewSubmissionService

func NewSubmissionService(
	logger *zap.Logger,
	ProblemService ProblemsService,
	Repository repositories.SubmissionRepository,
	FileService FilesService,
	JudgementService JudgementsService,
) SubmissionsService

Jump to

Keyboard shortcuts

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