Documentation ¶
Index ¶
- Variables
- func All[T Ptr[U], U any](d *Data, dt DataType) ([]T, error)
- func Each[T Ptr[U], U any](d *Data, dt DataType, fn func(T) error) error
- func EachRaw(d *Data, dt DataType, fn func(map[string]any) error) error
- type ArchiveInfo
- type Data
- type DataFile
- type DataType
- type Link
- type Manifest
- type Media
- type Mention
- type Profile
- type Ptr
- type Tweet
- type TweetSearchIndex
- type UserInfo
- type Variant
Constants ¶
This section is empty.
Variables ¶
var ErrBreak = errors.New("end each iterator")
ErrBreak exits the Each iterator.
Functions ¶
Types ¶
type ArchiveInfo ¶
type ArchiveInfo struct { GenerationDate time.Time `json:"generationDate"` SizeBytes int64 `json:"sizeBytes"` MaxPartSizeBytes int64 `json:"maxPartSizeBytes"` IsPartialArchive bool `json:"isPartialArchive"` }
ArchiveInfo is the structure of the archive info section of the manifest.json file.
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data is a struct that provides an interface to the data archive.
func (*Data) EachProfile ¶
EachProfile calls fn for each Profile item.
type DataFile ¶
type DataFile struct { Name string `json:"fileName"` Preamble string `json:"globalName"` Count int64 `json:"count"` }
DataFile is the structure of the data file sections of the manifest.json file.
type DataType ¶
type DataType struct { MediaDir string `json:"mediaDirectory,omitempty"` Files []DataFile `json:"files"` }
DataType is the structure of the data type sections of the manifest.json file.
type Link ¶
type Link struct { DisplayURL string `json:"display_url"` ExpandedURL string `json:"expanded_url"` }
Link represents a link in a tweet.
type Manifest ¶
type Manifest struct { DataTypes struct { Account DataType `json:"account"` AccountCreationIP DataType `json:"accountCreationIp"` AccountLabel DataType `json:"accountLabel"` AccountSuspension DataType `json:"accountSuspension"` AccountTimezone DataType `json:"accountTimezone"` AdEngagements DataType `json:"adEngagements"` AdImpressions DataType `json:"adImpressions"` AdMobileConversionsUnattributed DataType `json:"adMobileConversionsUnattributed"` AdMobileConversionsAttributed DataType `json:"adMobileConversionsAttributed"` AdOnlineConversionsUnattributed DataType `json:"adOnlineConversionsUnattributed"` AdOnlineConversionsAttributed DataType `json:"adOnlineConversionsAttributed"` AgeInfo DataType `json:"ageInfo"` App DataType `json:"app"` Block DataType `json:"block"` BranchLinks DataType `json:"branchLinks"` CatalogItem DataType `json:"catalogItem"` CommerceCatalog DataType `json:"commerceCatalog"` CommunityNote DataType `json:"communityNote"` CommunityNoteRating DataType `json:"communityNoteRating"` CommunityNoteTombstone DataType `json:"communityNoteTombstone"` CommunityTweet DataType `json:"communityTweet"` ConnectedApplication DataType `json:"connectedApplication"` Contact DataType `json:"contact"` DeletedNoteTweet DataType `json:"deletedNoteTweet"` DeletedTweetHeaders DataType `json:"deletedTweetHeaders"` DeletedTweets DataType `json:"deletedTweets"` DeviceToken DataType `json:"deviceToken"` DirectMessageGroupHeaders DataType `json:"directMessageGroupHeaders"` DirectMessageHeaders DataType `json:"directMessageHeaders"` DirectMessageMute DataType `json:"directMessageMute"` DirectMessages DataType `json:"directMessages"` DirectMessagesGroup DataType `json:"directMessagesGroup"` EmailAddressChange DataType `json:"emailAddressChange"` Follower DataType `json:"follower"` Following DataType `json:"following"` IPAudit DataType `json:"ipAudit"` KeyRegistry DataType `json:"keyRegistry"` Like DataType `json:"like"` ListsCreated DataType `json:"listsCreated"` ListsMember DataType `json:"listsMember"` ListsSubscribed DataType `json:"listsSubscribed"` Moment DataType `json:"moment"` Mute DataType `json:"mute"` NIDevices DataType `json:"niDevices"` NoteTweet DataType `json:"noteTweet"` PeriscopeAccountInformation DataType `json:"periscopeAccountInformation"` PeriscopeBanInformation DataType `json:"periscopeBanInformation"` PeriscopeBroadcastMetadata DataType `json:"periscopeBroadcastMetadata"` PeriscopeCommentsMadeByUser DataType `json:"periscopeCommentsMadeByUser"` PeriscopeExpiredBroadcasts DataType `json:"periscopeExpiredBroadcasts"` PeriscopeFollowers DataType `json:"periscopeFollowers"` PeriscopeProfileDescription DataType `json:"periscopeProfileDescription"` Personalization DataType `json:"personalization"` PhoneNumber DataType `json:"phoneNumber"` ProductDrop DataType `json:"productDrop"` ProductSet DataType `json:"productSet"` ProfessionalData DataType `json:"professionalData"` Profile DataType `json:"profile"` ProtectedHistory DataType `json:"protectedHistory"` ReplyPrompt DataType `json:"replyPrompt"` SavedSearch DataType `json:"savedSearch"` ScreenNameChange DataType `json:"screenNameChange"` ShopModule DataType `json:"shopModule"` ShopifyAccount DataType `json:"shopifyAccount"` Smartblock DataType `json:"smartblock"` SpacesMetadata DataType `json:"spacesMetadata"` SSO DataType `json:"sso"` TweetHeaders DataType `json:"tweetHeaders"` TweetDeck DataType `json:"tweetdeck"` Tweets DataType `json:"tweets"` TwitterArticle DataType `json:"twitterArticle"` TwitterArticleMetadata DataType `json:"twitterArticleMetadata"` TwitterCircle DataType `json:"twitterCircle"` TwitterCircleMember DataType `json:"twitterCircleMember"` TwitterCircleTweet DataType `json:"twitterCircleTweet"` TwitterShop DataType `json:"twitterShop"` UserLinkClicks DataType `json:"userLinkClicks"` Verified DataType `json:"verified"` } `json:"dataTypes"` UserInfo UserInfo `json:"userInfo"` ArchiveInfo ArchiveInfo `json:"archiveInfo"` }
Manifest is the structure of the manifest.json file.
type Media ¶
type Media struct { ExpandedURL string `json:"expanded_url"` URL string `json:"url"` MediaURL string `json:"media_url"` Type string `json:"type"` DisplayURL string `json:"display_url"` ID int64 `json:"id"` SourceStatusID int64 `json:"source_status_id"` }
Media represents a media item in a tweet.
type Mention ¶
type Mention struct { Name string `json:"name"` ScreenName string `json:"screen_name"` ID int64 `json:"id"` }
Mention represents a mention of a user in a tweet.
type Profile ¶
type Profile struct { Description struct { Bio string `json:"bio"` Website string `json:"website"` Location string `json:"location"` } `json:"description"` Avatar string `json:"avatarMediaUrl"` Header string `json:"headerMediaUrl"` }
Profile is the structure of the data/profile.js file.
type Tweet ¶
type Tweet struct { CreatedAt time.Time `json:"created_at"` URLMap map[string]Link `json:"urlmap"` FullText string `json:"full_text"` Mentions []Mention `json:"mentions"` Media []Media `json:"media"` InReplyToUserID int64 `json:"in_reply_to_user_id"` InReplyToStatusID int64 `json:"in_reply_to_status_id"` ID int64 `json:"id"` RetweetCount int64 `json:"retweet_count"` FavoriteCount int64 `json:"favorite_count"` }
Tweet represents a single tweet.
func (*Tweet) SearchIndex ¶ added in v1.2.0
func (t *Tweet) SearchIndex() TweetSearchIndex
SearchIndex returns a search index entry for a tweet.
type TweetSearchIndex ¶ added in v1.2.0
TweetSearchIndex represents a search index entry for a tweet.