atcoder

package
v0.0.0-...-2888c8f Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JapanZone = time.FixedZone("JST", 9*60*60)

JapanZone 東京のタイムゾーン

Functions

func IsInvalidFinishTime

func IsInvalidFinishTime(t time.Time) bool

Types

type Client

type Client struct {
	ID, Pass string
	Client   *http.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(id, pass string) (*Client, error)

func (*Client) GetActiveContests

func (client *Client) GetActiveContests() ([]Contest, error)

func (*Client) GetLanguage

func (client *Client) GetLanguage() string

func (*Client) GetRecentContests

func (client *Client) GetRecentContests() ([]Contest, error)

func (*Client) GetUpcomingContests

func (client *Client) GetUpcomingContests() ([]Contest, error)

func (*Client) Login

func (client *Client) Login() error

func (*Client) SetLanguage

func (client *Client) SetLanguage(lang string)

type Contest

type Contest struct {
	Title      string
	StartTime  time.Time
	FinishTime time.Time
	URL        string
	TitleInURL string
	// contains filtered or unexported fields
}

func (*Contest) GetMyStatus

func (contest *Contest) GetMyStatus() (string, error)

func (*Contest) IsJoined

func (contest *Contest) IsJoined() (bool, error)

func (*Contest) Join

func (contest *Contest) Join() error

func (*Contest) Standings

func (contest *Contest) Standings() (*Standings, error)

func (*Contest) UpdateClient

func (contest *Contest) UpdateClient(client *http.Client)

type Standings

type Standings struct {
	Rank int `json:"rank,omitempty"` // What's this?

	Tasks []StandingsTask `json:"tasks"`

	Users []StandingsUser `json:"users"`
}

type StandingsResponse

type StandingsResponse struct {
	Status   int    `json:"status"`
	Message  string `json:"message"`
	Response []struct {
		Rank  int `json:"rank,omitempty"`
		Tasks []struct {
			StandingsTask
			StandingsUserTask
		} `json:"tasks"`
		UserName       string `json:"user_name,omitempty"`
		UserScreenName string `json:"user_screen_name,omitempty"`
		Failure        string `json:"failure,omitempty"`
		Penalty        string `json:"penalty,omitempty"`
		Score          int    `json:"score,omitempty"`
	} `json:"response"`
	Count int `json:"count"`
}

StandingsResponse was generated With JSON-to-Go

type StandingsTask

type StandingsTask struct {
	TaskName       string `json:"task_name"`
	TaskScreenName string `json:"task_screen_name"`
}

type StandingsUser

type StandingsUser struct {
	UserName       string              `json:"user_name,omitempty"`
	UserScreenName string              `json:"user_screen_name,omitempty"`
	Failure        string              `json:"failure,omitempty"`
	Penalty        string              `json:"penalty,omitempty"`
	Score          int                 `json:"score,omitempty"`
	Tasks          []StandingsUserTask `json:"tasks"`
}

type StandingsUserTask

type StandingsUserTask struct {
	Extras      bool   `json:"extras"`
	Score       int    `json:"score"`
	Failure     int    `json:"failure"`
	ElapsedTime string `json:"elapsed_time"`
}

Jump to

Keyboard shortcuts

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