Documentation ¶
Index ¶
- type Client
- func (c *Client) ExchangeTokensWithCode(ctx context.Context, code, state string) (*oauth2.Token, error)
- func (c *Client) GetAuthURL(ctx context.Context, state string) string
- func (c *Client) GetListMembers(ctx context.Context, token *oauth2.Token, listID string, maxResults int, ...) (*ListMemberResponse, error)
- func (c *Client) GetTweetByID(ctx context.Context, token *oauth2.Token, tweetID string) (*TweetResponse, error)
- func (c *Client) GetTweetsByIDs(ctx context.Context, token *oauth2.Token, tweetIDs []string) (*TweetsResponse, error)
- func (c *Client) GetTweetsFromList(ctx context.Context, token *oauth2.Token, listID string, maxResults int, ...) (*TweetsResponse, error)
- func (c *Client) GetUserInfo(ctx context.Context, token *oauth2.Token) (*UserResponse, error)
- func (c *Client) PostTweet(ctx context.Context, token *oauth2.Token, tweet string) (string, error)
- func (c *Client) RefreshAccessToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
- func (c *Client) ValidateToken(ctx context.Context, token *oauth2.Token) error
- type Config
- type ListMemberResponse
- type OAuthResponse
- type TweetEntities
- type TweetObject
- type TweetPublicMetrics
- type TweetReferencedTweets
- type TweetResponse
- type TweetsResponse
- type User
- type UserPublicMetrics
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ExchangeTokensWithCode ¶
func (*Client) GetListMembers ¶ added in v0.0.5
func (c *Client) GetListMembers(ctx context.Context, token *oauth2.Token, listID string, maxResults int, paginationToken string) (*ListMemberResponse, error)
GetListMembers retrieves members of a Twitter List
func (*Client) GetTweetByID ¶ added in v0.0.5
func (*Client) GetTweetsByIDs ¶ added in v0.0.5
func (*Client) GetTweetsFromList ¶ added in v0.0.5
func (c *Client) GetTweetsFromList(ctx context.Context, token *oauth2.Token, listID string, maxResults int, paginationToken string) (*TweetsResponse, error)
GetTweetsFromList retrieves recent tweets from a given Twitter List
func (*Client) GetUserInfo ¶
func (*Client) RefreshAccessToken ¶
type ListMemberResponse ¶ added in v0.0.5
type OAuthResponse ¶
type TweetEntities ¶ added in v0.0.5
type TweetEntities struct { Urls []struct { URL string `json:"url"` ExpandedURL string `json:"expanded_url"` DisplayURL string `json:"display_url"` } `json:"urls"` Tag string `json:"tag"` Start int `json:"start"` End int `json:"end"` } `json:"hashtags"` Mentions []struct { Username string `json:"username"` Start int `json:"start"` End int `json:"end"` ID string `json:"id"` } `json:"mentions"` Annotations []struct { Start int `json:"start"` End int `json:"end"` Probability float64 `json:"probability"` Type string `json:"type"` NormalizedText string `json:"normalized_text"` } `json:"annotations"` CashTags []struct { Start int `json:"start"` End int `json:"end"` Tag string `json:"tag"` } `json:"cashtags"` }
type TweetObject ¶ added in v0.0.5
type TweetObject struct { ID string `json:"id"` Text string `json:"text"` Lang string `json:"lang"` InReplyToUserID string `json:"in_reply_to_user_id"` AuthorID string `json:"author_id"` // Entities Entities TweetEntities `json:"entities"` // PublicMetrics PublicMetrics TweetPublicMetrics `json:"public_metrics"` // ReferencedTweets ReferencedTweets TweetReferencedTweets `json:"referenced_tweets"` // time CreatedAt *time.Time `json:"created_at"` }
func (*TweetObject) GetFirstURL ¶ added in v0.0.5
func (t *TweetObject) GetFirstURL() string
func (*TweetObject) HasReferencedTweets ¶ added in v0.0.5
func (t *TweetObject) HasReferencedTweets() bool
func (*TweetObject) HasURL ¶ added in v0.0.5
func (t *TweetObject) HasURL() bool
type TweetPublicMetrics ¶ added in v0.0.5
type TweetReferencedTweets ¶ added in v0.0.5
type TweetResponse ¶ added in v0.0.5
type TweetResponse struct { Data TweetObject `json:"data"` Includes struct { Users []User `json:"users"` Tweets []TweetObject `json:"tweets"` } `json:"includes"` }
func (*TweetResponse) GetReferencedTweetByID ¶ added in v0.0.5
func (t *TweetResponse) GetReferencedTweetByID(id string) *TweetObject
func (*TweetResponse) GetUserByID ¶ added in v0.0.5
func (t *TweetResponse) GetUserByID(id string) *User
type TweetsResponse ¶ added in v0.0.5
type TweetsResponse struct { Data []TweetObject `json:"data"` Includes struct { Users []User `json:"users"` Tweets []TweetObject `json:"tweets"` } `json:"includes"` Meta struct { ResultCount int64 `json:"result_count"` PreviousToken string `json:"previous_token"` NextToken string `json:"next_token"` } `json:"meta"` }
func (*TweetsResponse) GetReferencedTweetByID ¶ added in v0.0.5
func (t *TweetsResponse) GetReferencedTweetByID(id string) *TweetObject
func (*TweetsResponse) GetUserByID ¶ added in v0.0.5
func (t *TweetsResponse) GetUserByID(id string) *User
func (*TweetsResponse) PrettyPrint ¶ added in v0.0.5
func (tr *TweetsResponse) PrettyPrint()
type User ¶ added in v0.0.5
type User struct { ID string `json:"id"` Name string `json:"name"` Username string `json:"username"` ProfileImageURL string `json:"profile_image_url"` PublicMetrics UserPublicMetrics `json:"public_metrics"` }
type UserPublicMetrics ¶ added in v0.0.5
Click to show internal directories.
Click to hide internal directories.