Documentation
¶
Overview ¶
Package xcontest is a client for https://tools.xcontest.org/.
Index ¶
- type Client
- func (c *Client) TaskURL(taskCode string) string
- func (c *Client) XCTskLoad(ctx context.Context, taskCode string) (*SavedTask, error)
- func (c *Client) XCTskLoadV2(ctx context.Context, taskCode string) (*SavedTaskV2, error)
- func (c *Client) XCTskQR(ctx context.Context, task *xctrack.QRCodeTask) ([]byte, error)
- func (c *Client) XCTskSave(ctx context.Context, task *xctrack.QRCodeTask, author string) (string, error)
- type ClientOption
- type SavedTask
- type SavedTaskV2
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
}
A Client is an XContest client.
func (*Client) XCTskLoadV2 ¶
XCTskLoadV2 loads the saved task with the given task code in QR code format.
type ClientOption ¶
type ClientOption func(*Client)
A ClientOption sets an option on a Client.
func WithBaseURL ¶
func WithBaseURL(baseURL string) ClientOption
WithBaseURL sets the base URL on a Client.
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets the http.Client used by a Client.
type SavedTaskV2 ¶
type SavedTaskV2 struct {
Task *xctrack.QRCodeTask
Author string
LastModified time.Time
}
A SavedTaskV2 is a saved task in QR code format.