pages

package
Version: v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PracticeContestID = "practice"
)

Variables

View Source
var ErrSubmissionNotFound = fmt.Errorf("submission not found")
View Source
var ErrTaskNameNotFound = fmt.Errorf("task name not found")
View Source
var ErrTestcasesFolderNotFound = fmt.Errorf("contest testcases folder not found")

Functions

func At

func At(s Scraper) (bool, error)

func TargetURL

func TargetURL(s Scraper) string

func To

func To(s Scraper) error

Types

type ContestPage

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

func NewContestPage

func NewContestPage(page *agouti.Page, contestID string) (*ContestPage, error)

func (*ContestPage) GetContest

func (p *ContestPage) GetContest() (*models.Contest, error)

func (*ContestPage) Hostname added in v0.1.0

func (p *ContestPage) Hostname() string

func (*ContestPage) IsJoined

func (p *ContestPage) IsJoined() (bool, error)

func (*ContestPage) Join

func (p *ContestPage) Join() error

func (*ContestPage) Navbar

func (p *ContestPage) Navbar() *modules.NavbarModule

func (*ContestPage) Page

func (p *ContestPage) Page() *agouti.Page

func (*ContestPage) TargetPath

func (p *ContestPage) TargetPath() string

type LoginPage

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

func NewLoginPage

func NewLoginPage(page *agouti.Page) (*LoginPage, error)

func (*LoginPage) Hostname added in v0.1.0

func (p *LoginPage) Hostname() string

func (*LoginPage) Login

func (p *LoginPage) Login(userID, password string) error

func (*LoginPage) Page

func (p *LoginPage) Page() *agouti.Page

func (*LoginPage) TargetPath

func (p *LoginPage) TargetPath() string

type Scraper

type Scraper interface {
	Page() *agouti.Page
	Hostname() string
	TargetPath() string
}

type SubmissionsPage

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

func NewSubmissionsPage

func NewSubmissionsPage(page *agouti.Page, contestID, taskID, status string, lang models.Language) (*SubmissionsPage, error)

func (*SubmissionsPage) GetSubmission

func (p *SubmissionsPage) GetSubmission(sbmID int) (*models.Submission, error)

func (*SubmissionsPage) GetSubmissions

func (p *SubmissionsPage) GetSubmissions() ([]*models.Submission, error)

func (*SubmissionsPage) Hostname added in v0.1.0

func (p *SubmissionsPage) Hostname() string

func (*SubmissionsPage) Page

func (p *SubmissionsPage) Page() *agouti.Page

func (*SubmissionsPage) TargetPath

func (p *SubmissionsPage) TargetPath() string

type TaskPage

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

func NewTaskPage

func NewTaskPage(page *agouti.Page, contestID string, taskID string) (*TaskPage, error)

func (*TaskPage) GetTask

func (p *TaskPage) GetTask() (*models.Task, error)

func (*TaskPage) Hostname added in v0.1.0

func (p *TaskPage) Hostname() string

func (*TaskPage) Page

func (p *TaskPage) Page() *agouti.Page

func (*TaskPage) SetLang

func (p *TaskPage) SetLang(lang models.Language) error

func (*TaskPage) SetSource

func (p *TaskPage) SetSource(source string) error

func (*TaskPage) Submit

func (p *TaskPage) Submit(lang models.Language, source string) error

func (*TaskPage) TargetPath

func (p *TaskPage) TargetPath() string

type TasksPage

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

func NewTasksPage

func NewTasksPage(page *agouti.Page, contestID string) (*TasksPage, error)

func (*TasksPage) GetTaskID

func (p *TasksPage) GetTaskID(taskName string) (string, error)

func (*TasksPage) GetTasks

func (p *TasksPage) GetTasks() ([]*models.Task, error)

func (*TasksPage) Hostname added in v0.1.0

func (p *TasksPage) Hostname() string

func (*TasksPage) Page

func (p *TasksPage) Page() *agouti.Page

func (*TasksPage) TargetPath

func (p *TasksPage) TargetPath() string

type TestcasesPage added in v0.1.0

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

func NewTestcasesPage added in v0.1.0

func NewTestcasesPage(page *agouti.Page) (*TestcasesPage, error)

func (*TestcasesPage) GetContestFolderURL added in v0.1.0

func (p *TestcasesPage) GetContestFolderURL(contestID string) (string, error)

func (*TestcasesPage) Hostname added in v0.1.0

func (p *TestcasesPage) Hostname() string

func (*TestcasesPage) Page added in v0.1.0

func (p *TestcasesPage) Page() *agouti.Page

func (*TestcasesPage) TargetPath added in v0.1.0

func (p *TestcasesPage) TargetPath() string

Jump to

Keyboard shortcuts

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