bggclient

package
v0.0.0-...-129c87e Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package bggclient encapsulates the setup of a TLS connection to https://boardgamegeek.com and is reponsible for including the user's login credentials as cookies with each HTTP request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(relativeURL *url.URL) (data []byte, err error)

Download handls an HTTP response that includes a file download.

func Get

func Get(relativeURL *url.URL) (page string, err error)

Get sends an HTTP GET request to the given URL.

func Post

func Post(relativeURL *url.URL, data url.Values) (res *http.Response, err error)

Post sends an HTTP POST request to the given URL with the given form data.

func SetCredentials

func SetCredentials(c Credentials)

SetCredentials creates cookies containing the BGG username and password hash for use by the client.

func Upload

func Upload(relativeURL *url.URL, data []byte, filename, fileFieldName string, fields map[string]string) (err error)

Upload sends an HTTP POST request with a file upload.

Types

type Credentials

type Credentials struct {
	Username string `toml:"username"`
	PassHash string `toml:"passhash"`
}

func (Credentials) IsSet

func (c Credentials) IsSet() bool

Jump to

Keyboard shortcuts

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