ejudge

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadStatusCode = errors.New("bad status code")
	ErrBadResult     = errors.New("bad result")
)
View Source
var (
	ErrInvalidCredentials = errors.New("invalid credentials")
)

Functions

This section is empty.

Types

type AuthHeader

type AuthHeader struct {
	ContestID uint
	Login     string
	Password  string
}

type EjClient

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

func NewEjClient

func NewEjClient(cfg *config.EjConfig) *EjClient

func (*EjClient) AuthUser

func (ej *EjClient) AuthUser(auth AuthHeader) error

func (*EjClient) ChangeRunStatus

func (ej *EjClient) ChangeRunStatus(status *EjStatusChange) error

func (*EjClient) GetContestRuns

func (ej *EjClient) GetContestRuns(id uint, filter string, count int) (*EjRuns, error)

func (*EjClient) GetContestStatus

func (ej *EjClient) GetContestStatus(id uint) (*EjContest, error)

func (*EjClient) GetRunSource

func (ej *EjClient) GetRunSource(contestID uint, runID uint) (string, error)

type EjContest

type EjContest struct {
	Contest struct {
		ID   uint   `json:"id"`
		Name string `json:"name"`
	} `json:"contest"`
	Problems []struct {
		ID        uint   `json:"id"`
		ShortName string `json:"short_name"`
		LongName  string `json:"long_name"`
	} `json:"problems"`
}

type EjRun

type EjRun struct {
	RunID     uint   `json:"run_id"`
	ContestID uint   `json:"-"` // not working, but it's not a problem
	UserLogin string `json:"user_login"`
	UserName  string `json:"user_name"`
	StatusStr string `json:"status_str"`
	ProbName  string `json:"prob_name"`
}

type EjRuns

type EjRuns struct {
	Runs      []EjRun `json:"runs"`
	TotalRuns uint    `json:"total_runs"`
}

type EjStatusChange

type EjStatusChange struct {
	ContestID uint
	RunID     uint
	Status    RunStatus
}

type RunStatus

type RunStatus int
const (
	RunStatusOK RunStatus = 0
	RunStatusRJ RunStatus = 17
)

! Do not touch! It's from ejudge source.

Jump to

Keyboard shortcuts

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