ccs

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(endpoint string, options ...ClientOption) *Client

NewClient returns new API client.

type ClientOption

type ClientOption func(*Client)

type Contest

type Contest struct {
	ID                       ID      `json:"id"`
	Name                     string  `json:"name"`
	StartTime                Time    `json:"start_time"`
	Duration                 RelTime `json:"duration"`
	ScoreboardFreezeDuration RelTime `json:"scoreboard_freeze_duration"`
	ScoreboardType           string  `json:"scoreboard_type"`
	PenaltyTime              int     `json:"penalty_time"`
}

func (Contest) Kind

func (e Contest) Kind() string

func (Contest) ObjectID

func (e Contest) ObjectID() any

type Event

type Event struct {
	Type  string    `json:"type"`
	ID    string    `json:"id,omitempty"`
	Data  EventData `json:"data"`
	Token string    `json:"token"`
}

type EventData

type EventData interface {
	Kind() string
	ObjectID() any
}

type ID

type ID int64

func (ID) MarshalJSON

func (v ID) MarshalJSON() ([]byte, error)

type Judgement

type Judgement struct {
	ID               ID      `json:"id"`
	SubmissionID     ID      `json:"submission_id"`
	JudgementTypeID  string  `json:"judgement_type_id,omitempty"`
	StartTime        Time    `json:"start_time"`
	StartContestTime RelTime `json:"start_contest_time"`
	EndTime          Time    `json:"end_time"`
	EndContestTime   RelTime `json:"end_contest_time"`
}

func (Judgement) Kind

func (e Judgement) Kind() string

func (Judgement) ObjectID

func (e Judgement) ObjectID() any

type JudgementType

type JudgementType struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Penalty bool   `json:"penalty"`
	Solved  bool   `json:"solved"`
}

func (JudgementType) Kind

func (e JudgementType) Kind() string

func (JudgementType) ObjectID

func (e JudgementType) ObjectID() any

type Language

type Language struct {
	ID                 ID       `json:"id"`
	Name               string   `json:"name"`
	EntryPointRequired bool     `json:"entry_point_required"`
	Extensions         []string `json:"extensions"`
}

func (Language) Kind

func (e Language) Kind() string

func (Language) ObjectID

func (e Language) ObjectID() any

type Organization

type Organization struct {
	ID   ID     `json:"id"`
	Name string `json:"name"`
}

func (Organization) Kind

func (e Organization) Kind() string

func (Organization) ObjectID

func (e Organization) ObjectID() any

type Problem

type Problem struct {
	ID            ID     `json:"id"`
	Label         string `json:"label"`
	Name          string `json:"name"`
	Ordinal       int    `json:"ordinal"`
	TimeLimit     int    `json:"time_limit"`
	TestDataCount int    `json:"test_data_count"`
}

func (Problem) Kind

func (e Problem) Kind() string

func (Problem) ObjectID

func (e Problem) ObjectID() any

type RelTime

type RelTime int

func (RelTime) MarshalJSON

func (v RelTime) MarshalJSON() ([]byte, error)

type State

type State struct {
	Started      Time  `json:"started"`
	Ended        *Time `json:"ended,omitempty"`
	Frozen       *Time `json:"frozen,omitempty"`
	Finalized    *Time `json:"finalized,omitempty"`
	EndOfUpdates *Time `json:"end_of_updates,omitempty"`
}

func (State) Kind

func (e State) Kind() string

func (State) ObjectID

func (e State) ObjectID() any

type Submission

type Submission struct {
	ID          ID      `json:"id"`
	TeamID      ID      `json:"team_id"`
	ProblemID   ID      `json:"problem_id"`
	LanguageID  ID      `json:"language_id"`
	Time        Time    `json:"time"`
	ContestTime RelTime `json:"contest_time"`
}

func (Submission) Kind

func (e Submission) Kind() string

func (Submission) ObjectID

func (e Submission) ObjectID() any

type Team

type Team struct {
	ID             ID     `json:"id"`
	Name           string `json:"name"`
	DisplayName    string `json:"display_name"`
	OrganizationID ID     `json:"organization_id"`
}

func (Team) Kind

func (e Team) Kind() string

func (Team) ObjectID

func (e Team) ObjectID() any

type Time

type Time time.Time

func (Time) MarshalJSON

func (v Time) MarshalJSON() ([]byte, error)

type View

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

func NewView

func NewView(core *core.Core) *View

func (*View) Register

func (v *View) Register(g *echo.Group)

Jump to

Keyboard shortcuts

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