goodreads

package
v0.0.0-...-12a24be Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: EUPL-1.2 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthenticatedUserID

func GetAuthenticatedUserID(token string) (string, error)

GetAuthenticatedUserID returns the userid of the oauthenticated user

func GetAuthenticationURL

func GetAuthenticationURL(apiKey, apiSecret, callbackURL string) (string, error)

GetAuthenticationURL returns the gr authentication URL to redirect to

func GetTokenCredentials

func GetTokenCredentials(oauthToken string) (string, error)

GetTokenCredentials requests and saves token credentials using the temporary oauth token returns token key

Types

type Author

type Author struct {
	ID   string `xml:"id"`
	Name string `xml:"name"`
	Link string `xml:"link"`
}

Author models a GR author object (contained in Books)

type Book

type Book struct {
	ID       string   `xml:"id"`
	Title    string   `xml:"title"`
	Link     string   `xml:"link"`
	ImageURL string   `xml:"image_url"`
	NumPages string   `xml:"num_pages"`
	Format   string   `xml:"format"`
	Authors  []Author `xml:"authors>author"`
	ISBN     string   `xml:"isbn"`
}

Book models a GR book object (contained in Shelves)

func GetShelf

func GetShelf(userid, token string) ([]Book, error)

GetShelf fetches the authenticated user's shelf

type Response

type Response struct {
	User    User     `xml:"user"`
	Book    Book     `xml:"book"`
	Books   []Book   `xml:"books>book"`
	Reviews []Review `xml:"reviews>review"`
}

Response models GR responses

type Review

type Review struct {
	Book   Book   `xml:"book"`
	Rating int    `xml:"rating"`
	ReadAt string `xml:"read_at"`
	Link   string `xml:"link"`
}

Review models a GR review object

type Shelf

type Shelf struct {
	ID        string `xml:"id"`
	BookCount string `xml:"book_count"`
	Name      string `xml:"name"`
}

Shelf models a GR shelf object (different from Review)

type User

type User struct {
	ID   string `xml:"id,attr"`
	Name string `xml:"name"`
	Link string `xml:"link"`
}

User models a GR user object

Jump to

Keyboard shortcuts

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