Documentation
¶
Index ¶
- func Bool(v bool) *bool
- func Float(v float64) *float64
- type APIError
- type Client
- type ErrorDetail
- type Tweet
- type TweetAttachments
- type TweetError
- type TweetInclude
- type TweetMedia
- type TweetNonPublicMetrics
- type TweetOrganicMetrics
- type TweetPublicMetrics
- type Tweets
- type TweetsService
- type TweetsShowParams
- type VideoNonPublicMetrics
- type VideoOrganicMetrics
- type VideoPublicMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
Errors []ErrorDetail `json:"errors"`
}
APIError represents a Twitter API Error response https://dev.twitter.com/overview/api/response-codes
type Client ¶
type Client struct {
Tweets *TweetsService
// contains filtered or unexported fields
}
Client is a Twitter client for making Twitter 2 API requests.
type ErrorDetail ¶
ErrorDetail represents an individual item in an APIError.
type Tweet ¶
type Tweet struct {
ID string `json:"id"`
Attachments *TweetAttachments `json:"attachments"`
AuthorID string `json:"author_id"`
CreatedAt string `json:"created_at"`
NonPublicMetrics *TweetNonPublicMetrics `json:"non_public_metrics"`
OrganicMetrics *TweetOrganicMetrics `json:"organic_metrics"`
PublicMetrics *TweetPublicMetrics `json:"public_metrics"`
Text string `json:"text"`
}
func (Tweet) AuthorIDInt64 ¶
AuthorIDInt64 returns the AuthorID as int64
func (Tweet) CreatedAtTime ¶
CreatedAtTime returns the time a tweet was created.
type TweetAttachments ¶
type TweetAttachments struct {
MediaKeys []string `json:"media_keys"`
}
type TweetError ¶
type TweetInclude ¶
type TweetInclude struct {
Media *[]TweetMedia `json:"media"`
}
type TweetMedia ¶
type TweetMedia struct {
DurationMS int64 `json:"duration_ms"`
Height int64 `json:"height"`
MediaKey string `json:"media_key"`
OrganicMetrics *VideoOrganicMetrics `json:"organic_metrics"`
NonPublicMetrics *VideoNonPublicMetrics `json:"non_public_metrics"`
PreviewImageURL string `json:"preview_image_url"`
PublicMetrics *VideoPublicMetrics `json:"public_metrics"`
Type string `json:"type"`
URL string `json:"url"`
Width int64 `json:"width"`
}
type TweetNonPublicMetrics ¶
type TweetOrganicMetrics ¶
type TweetPublicMetrics ¶
type Tweets ¶
type Tweets struct {
Data []Tweet `json:"data"`
Errors []TweetError `json:"errors"`
Includes *TweetInclude `json:"includes"`
}
type TweetsService ¶
type TweetsService struct {
// contains filtered or unexported fields
}
TweetsService provides methods for accessing Twitter tweets API endpoints.
func (*TweetsService) Show ¶
func (s *TweetsService) Show(params *TweetsShowParams) (Tweets, *http.Response, error)
Show returns the requested Tweet. https://developer.twitter.com/en/docs/twitter-api/tweets
type TweetsShowParams ¶
type TweetsShowParams struct {
IDs []int64
IncludeMedia *bool
IncludeTweetPublicMetrics *bool
IncludeTweetNonPublicMetrics *bool
IncludeTweetOrganicMetrics *bool
IncludeMediaPublicMetrics *bool
IncludeMediaNonPublicMetrics *bool
IncludeMediaOrganicMetrics *bool
}
TweetsShowParams are the parameters for TweetsService.Show
type VideoNonPublicMetrics ¶
type VideoNonPublicMetrics struct {
ViewCount int `json:"view_count"`
}
type VideoOrganicMetrics ¶
type VideoOrganicMetrics struct {
ViewCount int `json:"view_count"`
}
type VideoPublicMetrics ¶
type VideoPublicMetrics struct {
ViewCount int `json:"view_count"`
}
Click to show internal directories.
Click to hide internal directories.