Documentation
¶
Index ¶
- Constants
- func CalendarURL(year int) string
- func DayURL(year, day int) string
- func InputURL(year, day int) string
- func IsDayUnlocked(year int, day int) (bool, error)
- func SubmitURL(year, day int) string
- type Client
- func (c *Client) GetDescription(year, day int) (HTMLContent, error)
- func (c *Client) GetExamples(year, day int) ([]string, error)
- func (c *Client) GetInput(year, day int) (string, error)
- func (c *Client) Request(req *http.Request) (*http.Response, error)
- func (c *Client) RequestData(req *http.Request) ([]byte, error)
- func (c *Client) SubmitAnswer(level Level, year, day int, answer string) (SubmissionOutcome, error)
- type DebugTransport
- type HTMLContent
- type Level
- type Markdown
- type Option
- type RequestError
- type SubmissionOutcome
- type UnknownResponseError
Constants ¶
View Source
const BaseURL = "https://adventofcode.com"
Variables ¶
This section is empty.
Functions ¶
func CalendarURL ¶
func IsDayUnlocked ¶
isDayUnlocked checks if a challenge is unlocked based on the given year and day.
Types ¶
type Client ¶
func (*Client) GetDescription ¶
func (c *Client) GetDescription(year, day int) (HTMLContent, error)
getDescription fetches the and parses the html content
func (*Client) SubmitAnswer ¶
type DebugTransport ¶
type DebugTransport struct {
Transport http.RoundTripper
}
func NewDebugTransport ¶
func NewDebugTransport() *DebugTransport
type HTMLContent ¶
type HTMLContent string
func (HTMLContent) ToMarkdown ¶
func (c HTMLContent) ToMarkdown(year int) (Markdown, error)
convert html to markdown
type Option ¶
type Option func(c *Client)
func WithRedirectPolicy ¶
WithRedirectPolicy sets a custom redirecct policy for the client
func WithTimeout ¶
WithTimeout sets the timeout duration for the client
func WithTransport ¶
func WithTransport(transport http.RoundTripper) Option
WithTransport sets a custom transport for the client
type RequestError ¶
func (RequestError) Error ¶
func (e RequestError) Error() string
type SubmissionOutcome ¶
type SubmissionOutcome int
const ( SubmissionCorrect SubmissionOutcome = iota SubmissionIncorrect SubmissionWait SubmissionWrongLevel SubmissionError )
func (SubmissionOutcome) String ¶
func (so SubmissionOutcome) String() string
type UnknownResponseError ¶
func (UnknownResponseError) Error ¶
func (e UnknownResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.