package
0.0.0-20241214180956-1ec58f292fcb
Repository: https://github.com/arylatt/advent-of-code.git
Documentation: pkg.go.dev
# Functions
New creates a new Client.
WithCacheTimeout allows to customize the cache timeout for the client.
WithHTTPClient allows to specify a custom HTTP client to use.
WithSessionToken allows to specify the token for the requests.
WithUserAgent allows customizing the User-Agent header sent in HTTP requests.
# Constants
DefaultCacheTime is the default time for returning cached results instead of calling AoC again, as per the guidelines for their API.
LeaderBoardURLFormat is the format for constructing request URLs for private leaderboards.
# Variables
ErrBadResponseCode is returned when the call to AoC received a non-200 HTTP response code.
ErrCacheNoValue is returned if no value is found in the cache for the given key.
ErrInvalidCacheTimeout is returned if a cache timeout less than the DefaultCacheTime is specified.
ErrRedirectBlocked is returned if the call to AoC returns a redirect response.
ErrSessionTokenMustBeProvided is returned if the client does not have a session token after all options have been applied.
# Structs
CacheEntry represents a cache entry with expiration.
Client is the caching AoC client.
DayCompletion represents a given days completion state.
Leaderboard represents a private AoC leaderboard.
Member represents a member on the leaderboard.
PartCompletion represents the completion state.