Documentation
¶
Index ¶
- Constants
- func GetLimit(httpResp *http.Response, key string) int
- func WrapPinterestError(httpResponse *http.Response, bodyResponse *Response, err error) error
- type AccessToken
- type Article
- type Attribution
- type Board
- type BoardCounts
- type Creator
- type Image
- type Images
- type Interest
- type Link
- type Media
- type MetadataPerson
- type Movie
- type Page
- type Pin
- type PinCounts
- type PinImage
- type PinMetadata
- type PinterestError
- type Place
- type Product
- type ProductOffer
- type Recipe
- type RecipeCategory
- type RecipeIngredient
- type RecipeServings
- type Response
- type TypeRatelimit
- type User
- type UserCounts
Constants ¶
View Source
const BOARD_FIELDS = "id,url,reason,counts,created_at,creator,description,image,privacy,name"
View Source
const INTEREST_FIELDS = "id,name"
View Source
const PIN_FIELDS = "id,link,note,url,attribution,color,board,counts,created_at,creator,image,media,metadata,original_link"
View Source
const USER_FIELDS = "first_name,last_name,url,account_type,bio,counts,created_at,id,image,username"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccessToken ¶ added in v1.2.0
type AccessToken struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
Scope []string `json:"scope"`
ErrorDescription string `json:"error_description"`
Error string `json:"error"`
}
AccessToken is a struct that represents a Access Token response from the Pinterest API.
type Article ¶
type Article struct {
PublishedAt iso8601.Time `json:"published_at"`
Description string `json:"description"`
Name string `json:"name"`
Authors []MetadataPerson `json:"authors"`
}
type Attribution ¶
type Attribution struct {
Title string `json:"title"`
Url string `json:"url"`
ProviderIconUrl string `json:"provider_icon_url"`
AuthorName string `json:"author_name"`
ProviderFaviconUrl string `json:"provider_favicon_url"`
AuthorUrl string `json:"author_url"`
ProviderName string `json:"provider_name"`
}
type Board ¶
type Board struct {
Id string `json:"id"`
Name string `json:"name"`
Url string `json:"url"`
Description string `json:"description"`
Creator Creator `json:"creator"`
CreatedAt iso8601.Time `json:"created_at"`
Counts BoardCounts `json:"counts"`
Image Images `json:"image"`
Privacy string `json:"privacy"`
}
Board is a struct that represents an individual board from the Pinterest API.
type BoardCounts ¶
type MetadataPerson ¶
type MetadataPerson struct {
Name string `json:"name"`
}
type Movie ¶
type Movie struct {
Rating string `json:"rating"`
Directors []MetadataPerson `json:"directors"`
Actors []MetadataPerson `json:"actors"`
Name string `json:"name"`
PublishedAt iso8601.Time `json:"published_at"`
}
type Pin ¶
type Pin struct {
Id string `json:"id"`
Link string `json:"link"`
Url string `json:"url"`
Creator Creator `json:"creator"`
Board Board `json:"board"`
CreatedAt iso8601.Time `json:"created_at"`
Note string `json:"note"`
Color string `json:"color"`
Counts PinCounts `json:"counts"`
Media Media `json:"json:"media"`
OriginalLink string `json:"original_link"`
Attribution Attribution `json:"attribution"`
Image PinImage `json:"image"`
Metadata PinMetadata `json:"metadata"`
}
type PinMetadata ¶
type PinterestError ¶
type PinterestError struct {
StatusCode int `json:"status_code"`
Message string `json:"message"`
Limit TypeRatelimit
}
PinterestError is a custom error that is passed for all non 200 responses from the API.
func (*PinterestError) Error ¶
func (e *PinterestError) Error() string
type Place ¶
type Place struct {
Category string `json:"category"`
Name string `json:"name"`
Locality string `json:"locality"`
Country string `json:"country"`
Region string `json:"region"`
Longitude float32 `json:"longitude"`
SourceUrl string `json:"source_url"`
Street string `json:"street"`
PostalCode string `json:"postal_code"`
Latitude float32 `json:"latitude"`
}
type Product ¶
type Product struct {
Name string `json:"name"`
Offer ProductOffer `json:"offer"`
}
type ProductOffer ¶
type Recipe ¶
type Recipe struct {
Servings RecipeServings `json:"servings"`
Name string `json:"name"`
Ingredients []RecipeCategory `json:"ingredients"`
}
type RecipeCategory ¶
type RecipeCategory struct {
Category string `json:"category"`
Ingredients []RecipeIngredient `json:"ingredients"`
}
type RecipeIngredient ¶
type RecipeServings ¶
type Response ¶
type Response struct {
Data interface{} `json:"data"`
Message string `json:"message"`
Type string `json:"type"`
Page Page `json:"page"`
}
Response is the base struct for all responses that come back from the Pinterest API.
type TypeRatelimit ¶
func GetRatelimit ¶
func GetRatelimit(httpResp *http.Response) TypeRatelimit
type User ¶
type User struct {
Id string `json:"id"`
Username string `json:"username"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Bio string `json:"bio"`
AccountType string `json:"account_type"`
Url string `json:"account_type"`
CreatedAt iso8601.Time `json:"created_at"`
Counts UserCounts `json:"counts"`
Image Images `json:"image"`
}
User is a struct that represents an individual user from the Pinterest API.
Click to show internal directories.
Click to hide internal directories.