atcodergo

package
v0.0.0-...-ca8e88b Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BASE_URL *base

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
	// contains filtered or unexported fields
}

Client for atcoder. available as http.Client

func NewClient

func NewClient() (*Client, error)

NewClient create new Client.

func (*Client) Languages

func (c *Client) Languages() ([]Language, error)

Languages lists up acceptable languages.

func (*Client) Login

func (c *Client) Login(username, password string) error

Login to atcoder. save csrf_token to client.

func (*Client) LoginWithNewSession

func (c *Client) LoginWithNewSession(username, password, file string) error

LoginWithNewSession try to login to atcoder. File contents are overwritten.

func (*Client) LoginWithSession

func (c *Client) LoginWithSession(file string) error

LoginWithSession try to login to atcoder. File contents are only read.

func (*Client) Logout

func (c *Client) Logout() error

Logout from atcoder. Removes session file if exists.

func (*Client) NewContestsPager

func (c *Client) NewContestsPager() *ContestsPager

NewContestsPager creates new ContestsPager.

func (*Client) NewSubmissionsPager

func (c *Client) NewSubmissionsPager(contestID string) *SubmissionsPager

NewSubmissionsPager creates new SubmissionsPager.

func (*Client) Submit

func (c *Client) Submit(contestID, taskID string, languageID string, program io.Reader) (*Submission, error)

Submit answer program for the task. Returns submission result (first of submission list).

func (*Client) TaskInfo

func (c *Client) TaskInfo(contestID, taskID string) (*TaskInfo, error)

func (*Client) Tasks

func (c *Client) Tasks(contestID string) ([]*Task, error)

Tasks gets tasks of the contest.

type Contest

type Contest = model.Contest

Contest

type Contest struct {
    Name  string
    ID    string // like "abc123"
    Kind  string // like "Algorithm", "Heuristics"...
    State string // "permanent", "upcoming", "archive"
}

type ContestsPager

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

ContestsPager is pager for contests. Atcoder's website serves contests list with pagination.

func (*ContestsPager) Next

func (pager *ContestsPager) Next() (contests []*Contest, ok bool)

Next returns next page's contests.

type IoStyle

type IoStyle = model.IoStyle

IoStyle represents input and output signature. Input and Output are machine readable sections. ~Desc is Description of ones.

type Language

type Language = model.Language

Language stand for "<option value={Language.Value} data-mime={Language.Datamime}>{Language.Text}</option>"

type NeedAuthError

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

func (*NeedAuthError) Error

func (e *NeedAuthError) Error() string

type Submission

type Submission = model.Submission

type SubmissionsPager

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

SubmissionsPager is pager for submissions. Atcoder serves submissions list with pagination.

func (*SubmissionsPager) Next

func (pager *SubmissionsPager) Next() (submissions []*Submission, ok bool)

parseSubmissions parses submission page. https://atcoder.jp/contests/practice/submissions/me

type Task

type Task = model.Task

Task

type TaskInfo

type TaskInfo = model.TaskInfo

TaskInfo is detailed information of a task. It is target to express [commonest task page] neither too much nor little.

type TestCase

type TestCase = model.TestCase

TestCase. Can be used to ascertain (.Input > `user program` == .Output).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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