Documentation ¶
Index ¶
- type AccountSettings
- type AccountSleepTime
- type Client
- func (c *Client) AddListMember(params *Params) (*List, *Response, error)
- func (c *Client) AddListMembers(params *Params) (*List, *Response, error)
- func (c *Client) Block(params *Params) (*User, *Response, error)
- func (c *Client) CreateList(params *Params) (*List, *Response, error)
- func (c *Client) DeleteList(params *Params) (*List, *Response, error)
- func (c *Client) DeleteListMember(params *Params) (*List, *Response, error)
- func (c *Client) DeleteListMembers(params *Params) (*List, *Response, error)
- func (c *Client) Favorite(params *Params) (*Tweet, *Response, error)
- func (c *Client) Follow(params *Params) (*User, *Response, error)
- func (c *Client) GET(path string, params *Params, data interface{}) (*Response, error)
- func (c *Client) GetAccessToken(verifier string) error
- func (c *Client) GetAccountSettings(params *Params) (*AccountSettings, *Response, error)
- func (c *Client) GetBlockIDs(params *Params) (*UserIDs, *Response, error)
- func (c *Client) GetBlockList(params *Params) (*UserList, *Response, error)
- func (c *Client) GetCSRFToken(params *Params) (*Cookie, *Response, error)
- func (c *Client) GetFavorites(params *Params) ([]Tweet, *Response, error)
- func (c *Client) GetFollowerIDs(params *Params) (*UserIDs, *Response, error)
- func (c *Client) GetFollowerList(params *Params) (*UserList, *Response, error)
- func (c *Client) GetFriendFollowingIDs(params *Params) (*UserIDs, *Response, error)
- func (c *Client) GetFriendFollowingList(params *Params) (*UserList, *Response, error)
- func (c *Client) GetFriendIDs(params *Params) (*UserIDs, *Response, error)
- func (c *Client) GetFriendList(params *Params) (*UserList, *Response, error)
- func (c *Client) GetFriendship(params *Params) (*Relationship, *Response, error)
- func (c *Client) GetFriendships(params *Params) ([]Friendship, *Response, error)
- func (c *Client) GetIncomingFriendships(params *Params) (*UserIDs, *Response, error)
- func (c *Client) GetList(params *Params) (*List, *Response, error)
- func (c *Client) GetListMembers(params *Params) (*ListMembers, *Response, error)
- func (c *Client) GetLists(params *Params) ([]List, *Response, error)
- func (c *Client) GetNoRetweetFriendshipIDs(params *Params) ([]string, *Response, error)
- func (c *Client) GetOutgoingFriendships(params *Params) (*UserIDs, *Response, error)
- func (c *Client) GetRateLimitStatus(params *Params) (*RateLimitStatus, *Response, error)
- func (c *Client) GetUser(params *Params) (*User, *Response, error)
- func (c *Client) GetUserProfileBanner(params *Params) (*Images, *Response, error)
- func (c *Client) GetUsers(params *Params) ([]User, *Response, error)
- func (c *Client) NewStreaming(method, urlStr string, params *Params) (*Streaming, error)
- func (c *Client) NewUserStream(params *Params) (*Streaming, error)
- func (c *Client) POST(path string, params *Params, data interface{}) (*Response, error)
- func (c *Client) ReportSpamUser(params *Params) (*User, *Response, error)
- func (c *Client) RequestTokenURL(callback string) (string, error)
- func (c *Client) SearchUsers(params *Params) ([]User, *Response, error)
- func (c *Client) Unblock(params *Params) (*User, *Response, error)
- func (c *Client) Unfavorite(params *Params) (*Tweet, *Response, error)
- func (c *Client) Unfollow(params *Params) (*User, *Response, error)
- func (c *Client) UpdateAccountSettings(params *Params) (*AccountSettings, *Response, error)
- func (c *Client) UpdateFriendship(params *Params) (*Relationship, *Response, error)
- func (c *Client) UpdateProfile(params *Params) (*User, *Response, error)
- func (c *Client) UpdateTweet(params *Params) (*Tweet, *Response, error)
- func (c *Client) VerifyCredentials(params *Params) (*User, *Response, error)
- type Cookie
- type Coordinates
- type Credentials
- type Cursor
- type DirectMessage
- type Entities
- type Entity
- type Error
- type Errors
- type Friendship
- type HashtagEntity
- type ID
- type Image
- type Images
- type Limit
- type List
- type ListMembers
- type MediaEntity
- type MediaEntitySize
- type MediaEntitySizes
- type Params
- type Place
- type PlaceBoundingBox
- type RateLimitContext
- type RateLimitStatus
- type Relationship
- type Response
- type Streaming
- type StreamingControlEvent
- type StreamingDeleteDirectMessageEvent
- type StreamingDeleteLocationEvent
- type StreamingDeleteTweetEvent
- type StreamingDeletedObject
- type StreamingDirectMessageEvent
- type StreamingDisconnectEvent
- type StreamingEnvelopeEvent
- type StreamingFriendsEvent
- type StreamingGeneralEvent
- type StreamingLimitEvent
- type StreamingListEvent
- type StreamingStatusWithheldEvent
- type StreamingTweetEvent
- type StreamingUserWithheldEvent
- type StreamingWarningEvent
- type StreamingWithheldObject
- type SymbolEntity
- type Time
- type TimeZone
- type TrendLocation
- type TrendPlaceType
- type Tweet
- type URLEntity
- type User
- type UserIDs
- type UserList
- type UserMentionEntity
- type VideoInfo
- type VideoInfoVariant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountSettings ¶
type AccountSettings struct { AllowContributorRequest string `json:"allow_contributor_request"` AllowDMsFrom string `json:"allow_dms_from"` AllowDMGroupsFrom string `json:"allow_dm_groups_from"` AlwaysUseHTTPS bool `json:"always_use_https"` DiscoverableByEmail bool `json:"discoverable_by_email"` DiscoverableByMobilePhone bool `json:"discoverable_by_mobile_phone"` DisplaySensitiveMedia bool `json:"display_sensitive_media"` GeoEnabled bool `json:"geo_enabled"` Language string `json:"language"` Protected bool `json:"protected"` ScreenName string `json:"screen_name"` ShowAllInlineMedia bool `json:"show_all_inline_media"` SleepTime AccountSleepTime `json:"sleep_time"` TimeZone TimeZone `json:"time_zone"` TranslatorType string `json:"translator_type"` TrendLocation []TrendLocation `json:"trend_location"` UseCookiePersonalization bool `json:"use_cookie_personalization"` }
type AccountSleepTime ¶
type Client ¶
type Client struct { OAuthClient oauth.Client AccessToken *Credentials RequestToken *Credentials URLFormat string UserStreamURL string }
func NewClient ¶
func NewClient(consumer, token *Credentials) *Client
func (*Client) AddListMember ¶
func (*Client) AddListMembers ¶
func (*Client) Block ¶
Block blocks the specified user from following the authenticating user. In addition the blocked user will not show in the authenticating users mentions or timeline (unless retweeted by another user). If a follow or friend relationship exists it is destroyed. https://dev.twitter.com/rest/reference/post/blocks/create
func (*Client) DeleteListMember ¶
func (*Client) DeleteListMembers ¶
func (*Client) Favorite ¶
Favorite favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful. https://dev.twitter.com/rest/reference/post/favorites/create
func (*Client) Follow ¶
Follow allows the authenticating users to follow the user specified in the ID parameter. https://dev.twitter.com/rest/reference/post/friendships/create
func (*Client) GetAccessToken ¶
func (*Client) GetAccountSettings ¶
func (c *Client) GetAccountSettings(params *Params) (*AccountSettings, *Response, error)
func (*Client) GetBlockIDs ¶
GetBlockIDs returns an array of numeric user ids the authenticating user is blocking. https://dev.twitter.com/rest/reference/get/blocks/ids
func (*Client) GetBlockList ¶
GetBlockList returns a collection of user objects that the authenticating user is blocking. https://dev.twitter.com/rest/reference/get/blocks/list
func (*Client) GetCSRFToken ¶
GetCSRFToken returns auth/csrf_token
func (*Client) GetFavorites ¶
GetFavorites returns the 20 most recent Tweets favorited by the authenticating or specified user. https://dev.twitter.com/rest/reference/get/favorites/list
func (*Client) GetFollowerIDs ¶
GetFollowerIDs returns a cursored collection of user IDs for every user following the specified user. https://dev.twitter.com/rest/reference/get/followers/ids
func (*Client) GetFollowerList ¶
GetFollowerList returns a cursored collection of user objects for users following the specified user. https://dev.twitter.com/rest/reference/get/followers/list
func (*Client) GetFriendFollowingIDs ¶
GetFriendFollowingIDs returns a cursored collection of common friends' user ID.
func (*Client) GetFriendFollowingList ¶
GetFriendFollowingList returns a cursored collection of common friends' user object.
func (*Client) GetFriendIDs ¶
GetFriendIDs returns a cursored collection of user IDs for every user the specified user is following (otherwise known as their “friends”). https://dev.twitter.com/rest/reference/get/friends/ids
func (*Client) GetFriendList ¶
GetFriendList returns a cursored collection of user objects for every user the specified user is following (otherwise known as their “friends”). https://dev.twitter.com/rest/reference/get/friends/list
func (*Client) GetFriendship ¶
func (c *Client) GetFriendship(params *Params) (*Relationship, *Response, error)
GetFriendship returns detailed information about the relationship between two arbitrary users. https://dev.twitter.com/rest/reference/get/friendships/show
func (*Client) GetFriendships ¶
func (c *Client) GetFriendships(params *Params) ([]Friendship, *Response, error)
GetFriendships returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. https://dev.twitter.com/rest/reference/get/friendships/lookup
func (*Client) GetIncomingFriendships ¶
GetIncomingFriendships returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user. https://dev.twitter.com/rest/reference/get/friendships/incoming
func (*Client) GetListMembers ¶
func (c *Client) GetListMembers(params *Params) (*ListMembers, *Response, error)
func (*Client) GetNoRetweetFriendshipIDs ¶
GetNoRetweetFriendshipIDs eturns a collection of user_ids that the currently authenticated user does not want to receive retweets from. Use POST friendships/update to set the “no retweets” status for a given user account on behalf of the current user. https://dev.twitter.com/rest/reference/get/friendships/no_retweets/ids
func (*Client) GetOutgoingFriendships ¶
GetOutgoingFriendships returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request. https://dev.twitter.com/rest/reference/get/friendships/outgoing
func (*Client) GetRateLimitStatus ¶
func (c *Client) GetRateLimitStatus(params *Params) (*RateLimitStatus, *Response, error)
func (*Client) GetUserProfileBanner ¶
func (*Client) NewStreaming ¶
func (*Client) ReportSpamUser ¶
func (*Client) SearchUsers ¶
func (*Client) Unblock ¶
Unblock un-blocks the user specified in the ID parameter for the authenticating user. Returns the un-blocked user in the requested format when successful. If relationships existed before the block was instated, they will not be restored. https://dev.twitter.com/rest/reference/post/blocks/destroy
func (*Client) Unfavorite ¶
Unfavorite un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful. https://dev.twitter.com/rest/reference/post/favorites/destroy
func (*Client) Unfollow ¶
Unfollow allows the authenticating user to unfollow the user specified in the ID parameter. https://dev.twitter.com/rest/reference/post/friendships/destroy
func (*Client) UpdateAccountSettings ¶
func (c *Client) UpdateAccountSettings(params *Params) (*AccountSettings, *Response, error)
func (*Client) UpdateFriendship ¶
func (c *Client) UpdateFriendship(params *Params) (*Relationship, *Response, error)
UpdateFriendship allows one to enable or disable retweets and device notifications from the specified user. https://dev.twitter.com/rest/reference/post/friendships/update
func (*Client) UpdateProfile ¶
UpdateProfile sets values that users are able to set under the "Account" tab of their settings page. https://dev.twitter.com/rest/reference/post/account/update_profile
func (*Client) UpdateTweet ¶
type Cookie ¶
type Cookie struct { Path string `json:"cookie_path"` Name string `json:"cookie_name"` Value string `json:"cookie_value"` Secure bool `json:"cookie_secure"` HTTPOnly bool `json:"cookie_httponly"` Maxage int64 `json:"cookie_maxage"` Domain string `json:"cookie_domain"` }
Cookie represents HTTP cookie
type Coordinates ¶
type Credentials ¶
type Credentials struct {
oauth.Credentials
}
func NewCredentials ¶
func NewCredentials(token, secret string) *Credentials
type DirectMessage ¶
type DirectMessage struct { ID CreatedAt Time `json:"created_at"` Entities Entities `json:"entities"` Recipient User `json:"recipient"` RecipientID int64 `json:"recipient_id"` RecipientScreenName string `json:"recipient_screen_name"` Sender User `json:"sender"` SenderID int64 `json:"sender_id"` SenderScreenName string `json:"sender_screen_name"` Text string `json:"text"` }
type Entities ¶
type Entities struct { Media []MediaEntity `json:"media"` URLs []URLEntity `json:"urls"` UserMentions []UserMentionEntity `json:"user_mentions"` Symbols []SymbolEntity `json:"symbols"` }
type Errors ¶
type Friendship ¶
type Friendship struct { ID Name string `json:"name"` ScreenName string `json:"screen_name"` Connections []string `json:"connections"` }
Friendship represent relationship of the authenticating user. Values for connections can be: following, following_requested, followed_by, none, blocking, muting. https://dev.twitter.com/rest/reference/get/friendships/lookup
type HashtagEntity ¶
type HashtagEntity SymbolEntity
type List ¶
type List struct { ID Slug string `json:"slug"` Name string `json:"name"` CreatedAt Time `json:"created_at"` URI string `json:"uri"` SubscriberCount int `json:"subscriber_count"` MemberCount int `json:"member_count"` Mode string `json:"mode"` FullName string `json:"full_name"` Description string `json:"description"` User User `json:"user"` Following bool `json:"following"` }
type ListMembers ¶
type MediaEntity ¶
type MediaEntitySize ¶
type MediaEntitySizes ¶
type MediaEntitySizes struct { Thumb MediaEntitySize `json:"thumb"` Large MediaEntitySize `json:"large"` Medium MediaEntitySize `json:"medium"` Small MediaEntitySize `json:"small"` }
type Params ¶
func (*Params) AddNextCursor ¶
func (*Params) AddPreviousCursor ¶
func (*Params) ToURLValues ¶
type Place ¶
type Place struct { Attributes map[string]string `json:"attributes"` BoundingBox PlaceBoundingBox `json:"bounding_box"` ContainedWithin []Place `json:"contained_within"` Country string `json:"country"` CountryCode string `json:"country_code"` FullName string `json:"full_name"` Geometry PlaceBoundingBox `json:"geometry"` ID string `json:"id"` Name string `json:"name"` PlaceType string `json:"place_type"` URL string `json:"url"` }
type PlaceBoundingBox ¶
type RateLimitContext ¶
type RateLimitStatus ¶
type RateLimitStatus struct { RateLimitContext RateLimitContext `json:"rate_limit_context"` Resources map[string]map[string]Limit `json:"resources"` }
type Relationship ¶
type Relationship struct { Relationship struct { Target struct { ID ScreenName string `json:"screen_name"` Following bool `json:"following"` FollowedBy bool `json:"followed_by"` } `json:"target"` Source struct { ID CanDM bool `json:"can_dm"` Blocking bool `json:"blocking"` Muting bool `json:"muting"` AllReplies bool `json:"all_replies"` WantRetweets bool `json:"want_retweets"` MarkedSpam bool `json:"marked_spam"` ScreenName string `json:"screen_name"` Following bool `json:"following"` FollowedBy bool `json:"followed_by"` NotificationsEnabled bool `json:"notifications_enabled"` } `json:"source"` } `json:"relationship"` }
Relationship represent relationship of between two arbitrary users. https://dev.twitter.com/rest/reference/get/friendships/show
type Streaming ¶
type StreamingControlEvent ¶
type StreamingControlEvent struct { Control struct { ControlURI string `json:"control_uri"` } `json:"control"` }
type StreamingDeleteDirectMessageEvent ¶
type StreamingDeleteDirectMessageEvent struct { Delete struct { DirectMessage StreamingDeletedObject `json:"direct_message"` } `json:"delete"` }
type StreamingDeleteTweetEvent ¶
type StreamingDeleteTweetEvent struct { Delete struct { Status StreamingDeletedObject `json:"status"` TimestampMS string `json:"timestamp_ms"` } `json:"delete"` }
type StreamingDeletedObject ¶
type StreamingDirectMessageEvent ¶
type StreamingDirectMessageEvent struct {
DirectMessage DirectMessage `json:"direct_message"`
}
type StreamingEnvelopeEvent ¶
type StreamingFriendsEvent ¶
type StreamingFriendsEvent struct {
Friends []int64 `json:"friends"`
}
type StreamingGeneralEvent ¶
type StreamingLimitEvent ¶
type StreamingLimitEvent struct { Limit struct { Track int `json:"track"` } `json:"limit"` }
type StreamingListEvent ¶
type StreamingListEvent struct { StreamingGeneralEvent TargetObject List `json:"target_object"` }
type StreamingStatusWithheldEvent ¶
type StreamingStatusWithheldEvent struct {
StatusWithheld StreamingWithheldObject `json:"status_withheld"`
}
type StreamingTweetEvent ¶
type StreamingTweetEvent struct { StreamingGeneralEvent TargetObject Tweet `json:"target_object"` }
type StreamingUserWithheldEvent ¶
type StreamingUserWithheldEvent struct {
UserWithheld StreamingWithheldObject `json:"user_withheld"`
}
type StreamingWarningEvent ¶
type StreamingWithheldObject ¶
type SymbolEntity ¶
type TrendLocation ¶
type TrendPlaceType ¶
type Tweet ¶
type Tweet struct { ID Contributors []int64 `json:"contributors"` Coordinates *Coordinates `json:"coordinates"` CreatedAt Time `json:"created_at"` CurrentUserRetweet ID `json:"current_user_retweet"` Entities Entities `json:"entities"` ExtendedEntities *Entities `json:"extended_entities"` FavoriteCount *int `json:"favorite_count"` Favorited *bool `json:"favorited"` FilterLevel string `json:"filter_level"` Geo *interface{} `json:"geo"` InReplyToScreenName *string `json:"in_reply_to_screen_name"` InReplyToStatusID *int64 `json:"in_reply_to_status_id"` InReplyToStatusIDStr *string `json:"in_reply_to_status_id_str"` InReplyToUserID *int64 `json:"in_reply_to_user_id"` InReplyToUserIDStr *string `json:"in_reply_to_user_id_str"` Lang *string `json:"lang"` Place *Place `json:"place"` PossiblySensitive *bool `json:"possibly_sensitive"` QuotedStatusID *int64 `json:"quoted_status_id"` QuotedStatusIDStr *string `json:"quoted_status_id_str"` QuotedStatus *Tweet `json:"quoted_status"` Scopes map[string]interface{} `json:"scopes"` RetweetCount *int `json:"retweet_count"` Retweeted bool `json:"retweeted"` RetweetedStatus *Tweet `json:"retweeted_status"` Source string `json:"source"` Text string `json:"text"` Truncated bool `json:"truncated"` User User `json:"user"` WithheldCopyright bool `json:"withheld_copyright"` WithheldInCountries []string `json:"withheld_in_countries"` WithheldScope string `json:"withheld_scope"` }
type User ¶
type User struct { ID ContributorsEnabled bool `json:"contributors_enabled"` CreatedAt Time `json:"created_at"` DefaultProfile bool `json:"default_profile"` DefaultProfileImage bool `json:"default_profile_image"` Description *string `json:"description"` Entities Entities `json:"entities"` FavouritesCount int `json:"favourites_count"` FollowRequestSent *bool `json:"follow_request_sent"` Following *bool `json:"following"` FollowersCount int `json:"followers_count"` FriendsCount int `json:"friends_count"` GeoEnabled bool `json:"geo_enabled"` IsTranslator bool `json:"is_translator"` Lang string `json:"lang"` ListedCount int `json:"listed_count"` Location *string `json:"location"` Name string `json:"name"` Notifications bool `json:"notifications"` ProfileBackgroundColor string `json:"profile_background_color"` ProfileBackgroundImageURL string `json:"profile_background_image_url"` ProfileBackgroundImageURLHttps string `json:"profile_background_image_url_https"` ProfileBackgroundTile bool `json:"profile_background_tile"` ProfileBannerURL string `json:"profile_banner_url"` ProfileImageURL string `json:"profile_image_url"` ProfileImageURLHttps string `json:"profile_image_url_https"` ProfileLinkColor string `json:"profile_link_color"` ProfileSidebarBorderColor string `json:"profile_sidebar_border_color"` ProfileSidebarFillColor string `json:"profile_sidebar_fill_color"` ProfileTextColor string `json:"profile_text_color"` ProfileUseBackgroundImage bool `json:"profile_use_background_image"` Protected bool `json:"protected"` ScreenName string `json:"screen_name"` ShowAllInlineMedia bool `json:"show_all_inline_media"` Status *Tweet `json:"status"` StatusesCount int `json:"statuses_count"` TimeZone *string `json:"time_zone"` URL *string `json:"url"` UTCOffset *int `json:"utc_offset"` Verified bool `json:"verified"` WithheldInCountries string `json:"withheld_in_countries"` WithheldScope string `json:"withheld_scope"` }
type UserMentionEntity ¶
type VideoInfo ¶
type VideoInfo struct { AspectRatio [2]int `json:"aspect_ratio"` DurationMillis int `json:"duration_millis"` Variants []VideoInfoVariant `json:"variants"` }