api

package
v0.0.30 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	SetHostUrl(hostUrl string)
	SetCookieJar(Jar http.CookieJar)

	NewAccountAPI() AccountAPI
	NewVolumeAPI() VolumeAPI
	NewJudgementAPI() JudgementAPI
	NewSubmissionAPI() SubmissionAPI
	NewProblemAPI() ProblemAPI
}

func New

func New() API

type AccountAPI

type AccountAPI interface {
	Create(username, password, email string) (*models.Account, error)
	Login(username, password string) error
	ResetCredential(username, oldPassword, newPassword string) error
	Test() (*models.Account, error)
}

func NewAccountAPI

func NewAccountAPI(client *resty.Client) AccountAPI

type JudgementAPI

type JudgementAPI interface {
	Create(programId, submissionId uint64) (*models.Judgement, error)
	QueryJudgements() ([]*models.Judgement, error)
	QueryJudgement(judgementId string) (*models.Judgement, error)
	CancelJudgement(judgementId string) (*models.Judgement, error)
}

func NewJudgementAPI

func NewJudgementAPI(client *resty.Client) JudgementAPI

type ProblemAPI

type ProblemAPI interface {
	//CreateProblem() )
	//GetProblems(c *gin.Context)
	GetProblem(problemName string) (*models.Problem, error)
}

func NewProblemAPI

func NewProblemAPI(client *resty.Client) ProblemAPI

type SubmissionAPI

type SubmissionAPI interface {
	Create(problemId, volume string) (int, *models.Submission, *models.Judgement, error)
}

func NewSubmissionAPI

func NewSubmissionAPI(client *resty.Client) SubmissionAPI

type VolumeAPI

type VolumeAPI interface {
	CreateVolume() (*models.Volume, error)
	CreateDirectory(volumeName, directory string) (*models.Volume, error)
	CreateFile(volumeName, filename string, file []byte) (*models.Volume, error)
	DownloadVolume(volumeName, directory string) ([]byte, error)
}

func NewVolumeAPI

func NewVolumeAPI(client *resty.Client) VolumeAPI

Jump to

Keyboard shortcuts

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