Documentation ¶
Index ¶
- type AoCClient
- func (acc *AoCClient) DownloadInputBytes(year, day int) ([]byte, error)
- func (acc *AoCClient) DownloadInputBytesContext(ctx context.Context, year, day int) ([]byte, error)
- func (acc *AoCClient) DownloadInputString(year, day int) (string, error)
- func (acc *AoCClient) DownloadInputStringContext(ctx context.Context, year, day int) (string, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AoCClient ¶
type AoCClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient creates a new http client and saves the session cookie on a struct for reuse
func (*AoCClient) DownloadInputBytes ¶
DownloadInputBytes downloads the personalized input for a given year and day combination the result is returned as a raw []byte for more complicated operations
func (*AoCClient) DownloadInputBytesContext ¶
DownloadInputBytesContext downloads the personalized input for a given year and day combination the result is returned as a raw []byte for more complicated operations
func (*AoCClient) DownloadInputString ¶
DownloadInputString downloads the personalized input for a given year and day combination the result is returned as a string
Example ¶
aoc := NewClient(os.Getenv("SESSION_TOKEN")) i, err := aoc.DownloadInputString(2021, 1) if err != nil { fmt.Printf("unable to download input: %v\n", err) os.Exit(1) } fmt.Println(i)
Output:
Click to show internal directories.
Click to hide internal directories.