api

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_URL = "https://adventofcode.com"
View Source
const DAY_URL = YEAR_URL + "/day/%v"
View Source
const OFFSEASON_REQS_PER_SEC = 25
View Source
const ONSEASON_REQS_PER_SEC = 10

Number of API requests allowed per second.

View Source
const USER_AGENT = "go.dalton.dog/aocgo"

USER_AGENT is used to identify requests from this program

View Source
const YEAR_URL = BASE_URL + "/%v"

Variables

View Source
var MasterClient httpClient

Functions

func InitClient

func InitClient(userSessionToken string)

InitClient creates the API client with a given user session token.

func NewGetReq

func NewGetReq(url string, sessionToken string) (*http.Response, error)

NewGetReq will make a request of a certain URL on behalf of a given user session token.

func SubmitAnswer

func SubmitAnswer(year int, day int, part int, userSession string, answer string) (*http.Response, error)

SubmitAnswer will submit an answer to a puzzle on behalf of a given user token.

Types

This section is empty.

Jump to

Keyboard shortcuts

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