Documentation ¶
Overview ¶
Index ¶
- Constants
- func AuthorizationURL(callback string) (string, *oauth.Credentials, error)
- func GetCredentials(tempCred *oauth.Credentials, verifier string) (*oauth.Credentials, url.Values, error)
- func SetConsumerKey(consumerKey string)
- func SetConsumerSecret(consumerSecret string)
- type API
- func (a *API) Close()
- func (a *API) DisableThrottling()
- func (a *API) EnableThrottling(rate time.Duration, bufferSize int64)
- func (a *API) GetBlogAvatar(baseHostname string, size int) (avatarUrl string, err error)
- func (a *API) GetBlogFollowers(baseHostname string, params url.Values) (users []User, err error)
- func (a *API) GetBlogInfo(baseHostname string) (blog Blog, err error)
- func (a *API) GetBlogLikes(baseHostname string, params url.Values) (likedPosts []Post, likedCount int, err error)
- func (a *API) GetBlogPosts(baseHostname string, params url.Values) (blogs []Blog, posts []Post, totalPosts int, err error)
- func (a *API) GetBlogPostsDraft(baseHostname string, params url.Values) (blogs []Blog, posts []Post, err error)
- func (a *API) GetBlogPostsQueue(baseHostname string, params url.Values) (blogs []Blog, posts []Post, err error)
- func (a *API) GetBlogPostsSubmission(baseHostname string, params url.Values) (blogs []Blog, posts []Post, err error)
- func (a *API) GetDelay() time.Duration
- func (a *API) GetTagged(tag string, params url.Values) (posts []Post, err error)
- func (a *API) GetUserDashboard() (posts []Post, err error)
- func (a *API) GetUserFollowing(params url.Values) (totalBlogs int, blogs []Blog, err error)
- func (a *API) GetUserInfo() (user User, err error)
- func (a *API) GetUserLikes(params url.Values) (likedPosts []Post, likedCount int, err error)
- func (a *API) PostBlog(bastHostname string, params url.Values) (err error)
- func (a *API) PostBlogDelete(baseHostname string, postID int) (err error)
- func (a *API) PostBlogEdit(baseHostname string, postID int) (err error)
- func (a *API) PostBlogReblog(baseHostname string, params url.Values) (err error)
- func (a *API) PostUserFollow(blogUrl string) (err error)
- func (a *API) PostUserFollowDelete(blogUrl string) (err error)
- func (a *API) PostUserLikePost(postID int, reblogKey string) (err error)
- func (a *API) PostUserLikePostDelete(postID int, reblogKey string) (err error)
- func (a *API) PostUserUnfollow(blogUrl string) (err error)
- func (a *API) PostUserUnlikePost(postID int, reblogKey string) (err error)
- func (a *API) ReturnRateLimitError(b bool)
- func (a *API) SetDelay(t time.Duration)
- type Blog
- type BodyContainer
- type Post
- type ResponseContainer
- type User
Constants ¶
const (
//BaseURL for all API calls
BaseURL = "https://api.tumblr.com/v2"
)
Variables ¶
This section is empty.
Functions ¶
func AuthorizationURL ¶
func AuthorizationURL(callback string) (string, *oauth.Credentials, error)
AuthorizationURL generates the authorization URL for the first part of the OAuth handshake. Redirect the user to this URL. This assumes that the consumer key has already been set (using SetConsumerKey).
func GetCredentials ¶
func GetCredentials(tempCred *oauth.Credentials, verifier string) (*oauth.Credentials, url.Values, error)
GetCredentials from Oauth provider
func SetConsumerKey ¶
func SetConsumerKey(consumerKey string)
SetConsumerKey will set the application-specific consumer_key used in the initial OAuth process This key is listed on https://dev.twitter.com/apps/YOUR_APP_ID/show
func SetConsumerSecret ¶
func SetConsumerSecret(consumerSecret string)
SetConsumerSecret will set the application-specific secret used in the initial OAuth process This secret is listed on https://dev.twitter.com/apps/YOUR_APP_ID/show
Types ¶
type API ¶
type API struct { Credentials *oauth.Credentials HTTPClient *http.Client // contains filtered or unexported fields }
API wraps a session representing a access token/secret, and is the root object to call methods from
func NewAPI ¶
NewAPI takes an user-specific access token and secret and returns a Api struct for that user.
func (*API) DisableThrottling ¶
func (a *API) DisableThrottling()
DisableThrottling is used to enable query throttling with the tokenbucket algorithm
func (*API) EnableThrottling ¶
EnableThrottling is used to enable query throttling with the tokenbucket algorithm
func (*API) GetBlogAvatar ¶
You can get a blog's avatar in 9 different sizes. The default size is 64x64.
func (*API) GetBlogFollowers ¶
Retrieve a Blog's Followers
func (*API) GetBlogInfo ¶
This method returns general information about the blog, such as the title, number of posts, and other high-level data.
func (*API) GetBlogLikes ¶
func (a *API) GetBlogLikes(baseHostname string, params url.Values) (likedPosts []Post, likedCount int, err error)
This method can be used to retrieve the publicly exposed likes from a blog.
func (*API) GetBlogPosts ¶
func (a *API) GetBlogPosts(baseHostname string, params url.Values) (blogs []Blog, posts []Post, totalPosts int, err error)
Retrieve Published Posts
func (*API) GetBlogPostsDraft ¶
func (*API) GetBlogPostsQueue ¶
func (a *API) GetBlogPostsQueue(baseHostname string, params url.Values) (blogs []Blog, posts []Post, err error)
Retrieve Queued Posts
func (*API) GetBlogPostsSubmission ¶
func (*API) GetUserDashboard ¶
Use this method to retrieve the dashboard that matches the OAuth credentials submitted with the request.
func (*API) GetUserFollowing ¶
Use this method to retrieve the blogs followed by the user whose OAuth credentials are submitted with the request.
func (*API) GetUserInfo ¶
Use this method to retrieve the user's account information that matches the OAuth credentials submitted with the request.
func (*API) GetUserLikes ¶
Use this method to retrieve the liked posts that match the OAuth credentials submitted with the request.
func (*API) PostBlogDelete ¶
func (*API) PostBlogReblog ¶
func (*API) PostUserFollowDelete ¶
Unfollow a blog
func (*API) PostUserLikePost ¶
Like a post
func (*API) PostUserLikePostDelete ¶
Unlike a post
func (*API) PostUserUnfollow ¶
func (*API) PostUserUnlikePost ¶
Unlike a post
func (*API) ReturnRateLimitError ¶
ReturnRateLimitError specifies behavior when the Twitter API returns a rate-limit error. If set to true, the query will fail and return the error instead of automatically queuing and retrying the query when the rate limit expires
type BodyContainer ¶
type BodyContainer struct {
Response ResponseContainer `json:"response"`
}
type ResponseContainer ¶
type ResponseContainer struct {
Blog Blog `json:"blog"`
}