twitter

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(db *gorm.DB) provider.Provider

Types

type Account

type Account struct {
	gorm.Model

	ID                  int            `json:"accountId,string"`
	Email               string         `json:"email"`
	CreatedVia          string         `json:"createdVia"`
	Username            string         `json:"username"`
	Created             types.DateTime `json:"createdAt"`
	DisplayName         string         `json:"accountDisplayName"`
	ScreenNameChanges   []ScreenNameChange
	EmailAddressChanges []EmailAddressChange
	LoginIPs            []LoginIP
	// contains filtered or unexported fields
}

func (Account) TableName

func (Account) TableName() string

type AdImpression

type AdImpression struct {
	gorm.Model
	DeviceInfoID             int
	DeviceInfo               DeviceInfo `json:"deviceInfo"`
	DisplayLocation          string     `json:"displayLocation"`
	PromotedTweetID          int
	PromotedTweet            Tweet
	AdvertiserID             int
	Advertiser               Advertiser
	MatchedTargetingCriteria []TargetingCriterion `json:"matchedTargetingCriteria" gorm:"many2many:twitter_ad_impressions_matched_targeting_criteria"`
	ImpressionTime           types.DateTime       `json:"impressionTime" gorm:"unique"`
}

func (AdImpression) TableName

func (AdImpression) TableName() string

func (*AdImpression) UnmarshalJSON

func (ai *AdImpression) UnmarshalJSON(b []byte) error

type Advertiser

type Advertiser struct {
	gorm.Model
	Name      string `gorm:"uniqueIndex:twitter_advertisers_key"`
	Lookalike bool   `gorm:"uniqueIndex:twitter_advertisers_key"`
}

func (Advertiser) TableName

func (Advertiser) TableName() string

type AgeInfoRecord

type AgeInfoRecord struct {
	gorm.Model
	Age       int
	BirthDate types.DateTime `json:"birthDate"`
}

func (AgeInfoRecord) TableName

func (AgeInfoRecord) TableName() string

func (*AgeInfoRecord) UnmarshalJSON

func (ai *AgeInfoRecord) UnmarshalJSON(b []byte) error

type AudienceAndAdvertiserRecord

type AudienceAndAdvertiserRecord struct {
	gorm.Model
	PersonalizationRecordID int
	NumAudiences            int          `json:"numAudiences,string"`
	Advertisers             []Advertiser `gorm:"many2many:twitter_audience_and_advertisers"`
	LookalikeAdvertisers    []Advertiser `gorm:"many2many:twitter_audience_and_lookalike_advertisers"`
}

func (AudienceAndAdvertiserRecord) TableName

func (AudienceAndAdvertiserRecord) TableName() string

func (*AudienceAndAdvertiserRecord) UnmarshalJSON

func (aaa *AudienceAndAdvertiserRecord) UnmarshalJSON(b []byte) error

type Conversation

type Conversation struct {
	gorm.Model
	ID             string          `json:"conversationId"`
	DirectMessages []DirectMessage `json:"messages"`
}

func (Conversation) TableName

func (Conversation) TableName() string

func (*Conversation) UnmarshalJSON

func (c *Conversation) UnmarshalJSON(b []byte) error

type DeviceInfo

type DeviceInfo struct {
	gorm.Model
	Identifier string `json:"deviceId" gorm:"uniqueIndex:twitter_device_infos_key"`
	Type       string `json:"deviceType" gorm:"uniqueIndex:twitter_device_infos_key"`
	OsType     string `json:"osType" gorm:"uniqueIndex:twitter_device_infos_key"`
}

func (DeviceInfo) TableName

func (DeviceInfo) TableName() string

type DirectMessage

type DirectMessage struct {
	gorm.Model
	ConversationID string
	ID             int                     `json:"id,string"`
	RecipientID    int                     `json:"recipientId,string"`
	Reactions      []DirectMessageReaction `json:"reactions"`
	URLs           []URL                   `json:"urls" gorm:"many2many:twitter_direct_message_urls"`
	Text           string                  `json:"text"`
	MediaURLs      []string                `json:"mediaUrls" gorm:"type:text"`
	SenderID       int                     `json:"senderId,string"`
	Created        time.Time               `json:"createdAt"`
}

func (DirectMessage) TableName

func (DirectMessage) TableName() string

func (*DirectMessage) UnmarshalJSON

func (dm *DirectMessage) UnmarshalJSON(b []byte) error

type DirectMessageReaction

type DirectMessageReaction struct {
	gorm.Model
	DirectMessageID int       `gorm:"uniqueIndex:twitter_direct_message_reactions_key"`
	SenderID        string    `json:"senderId"`
	Key             string    `json:"reactionKey" gorm:"uniqueIndex:twitter_direct_message_reactions_key"`
	EventID         string    `json:"eventId"`
	Created         time.Time `json:"createdAt"`
}

func (DirectMessageReaction) TableName

func (DirectMessageReaction) TableName() string

type EmailAddressChange

type EmailAddressChange struct {
	gorm.Model
	AccountID   int            `gorm:"uniqueIndex:twitter_email_address_changes_key"`
	ChangedAt   types.DateTime `json:"changedAt" gorm:"uniqueIndex:twitter_email_address_changes_key"`
	ChangedFrom string         `json:"changedFrom" gorm:"uniqueIndex:twitter_email_address_changes_key"`
	ChangedTo   *string        `json:"changedTo" gorm:"uniqueIndex:twitter_email_address_changes_key"`
}

func (EmailAddressChange) Conditions

func (eac EmailAddressChange) Conditions() map[string]interface{}

func (EmailAddressChange) TableName

func (EmailAddressChange) TableName() string

type GenderInfo

type GenderInfo struct {
	gorm.Model
	Gender string `json:"gender" gorm:"unique"`
}

func (GenderInfo) TableName

func (GenderInfo) TableName() string

type Hashtag

type Hashtag struct {
	gorm.Model
	Text string `json:"text" gorm:"unique"`
}

func (Hashtag) TableName

func (Hashtag) TableName() string

type InferredAgeInfoRecord

type InferredAgeInfoRecord struct {
	gorm.Model
	PersonalizationRecordID int
	Age                     []string `json:"age" gorm:"type:text"`
	BirthDate               string   `json:"birthDate"`
}

func (InferredAgeInfoRecord) TableName

func (InferredAgeInfoRecord) TableName() string

type InterestRecord

type InterestRecord struct {
	gorm.Model
	PersonalizationRecordID int
	Name                    string `json:"name"`
	IsDisabled              bool   `json:"isDisabled"`
}

func (InterestRecord) TableName

func (InterestRecord) TableName() string

type LanguageRecord

type LanguageRecord struct {
	gorm.Model
	PersonalizationRecordID int
	Language                string `json:"language"`
	IsDisabled              bool   `json:"isDisabled"`
}

func (LanguageRecord) TableName

func (LanguageRecord) TableName() string

type Like

type Like struct {
	gorm.Model
	TweetID     int `json:"tweetId,string" gorm:"unique"`
	Tweet       Tweet
	FullText    string `json:"fullText"`
	ExpandedURL string `json:"expandedUrl"`
}

func (Like) TableName

func (Like) TableName() string

func (*Like) UnmarshalJSON

func (l *Like) UnmarshalJSON(b []byte) error

type Location

type Location struct {
	gorm.Model
	Name string `json:"name" gorm:"unique"`
}

func (Location) TableName

func (Location) TableName() string

type LoginIP

type LoginIP struct {
	gorm.Model
	AccountID int            `json:"accountId,string" gorm:"uniqueIndex:twitter_login_ips_key"`
	IP        string         `json:"loginIp" gorm:"uniqueIndex:twitter_login_ips_key"`
	Created   types.DateTime `json:"createdAt" gorm:"uniqueIndex:twitter_login_ips_key"`
}

func (LoginIP) Conditions

func (li LoginIP) Conditions() map[string]interface{}

func (LoginIP) TableName

func (LoginIP) TableName() string

type PersonalizationRecord

type PersonalizationRecord struct {
	gorm.Model
	Languages              []LanguageRecord
	GenderInfoID           int
	GenderInfo             GenderInfo
	Interests              []InterestRecord
	AudienceAndAdvertisers AudienceAndAdvertiserRecord
	Shows                  []Show                `gorm:"many2many:twitter_personalization_shows"`
	LocationHistory        []Location            `gorm:"many2many:twitter_personalization_locations"`
	InferredAgeInfo        InferredAgeInfoRecord `json:"inferredAgeInfo"`
}

func (PersonalizationRecord) TableName

func (PersonalizationRecord) TableName() string

func (*PersonalizationRecord) UnmarshalJSON

func (p *PersonalizationRecord) UnmarshalJSON(b []byte) error

type ScreenNameChange

type ScreenNameChange struct {
	gorm.Model
	AccountID   int            `gorm:"uniqueIndex:twitter_screen_name_changes_key"`
	ChangedAt   types.DateTime `json:"changedAt" gorm:"uniqueIndex:twitter_screen_name_changes_key"`
	ChangedFrom string         `json:"changedFrom" gorm:"uniqueIndex:twitter_screen_name_changes_key"`
	ChangedTo   *string        `json:"changedTo" gorm:"uniqueIndex:twitter_screen_name_changes_key"`
}

func (ScreenNameChange) Conditions

func (snc ScreenNameChange) Conditions() map[string]interface{}

func (ScreenNameChange) TableName

func (ScreenNameChange) TableName() string

type Show

type Show struct {
	gorm.Model
	Name string `gorm:"unique"`
}

func (Show) TableName

func (Show) TableName() string

type TargetingCriterion

type TargetingCriterion struct {
	gorm.Model
	TargetingType  string `json:"targetingType" gorm:"uniqueIndex:twitter_targeting_criterion_key"`
	TargetingValue string `json:"targetingValue" gorm:"uniqueIndex:twitter_targeting_criterion_key"`
}

func (TargetingCriterion) TableName

func (TargetingCriterion) TableName() string

type Tweet

type Tweet struct {
	gorm.Model
	ID                 int `json:"id,string"`
	AuthorID           *int
	Author             *User
	Retweeted          bool          `json:"retweeted"`
	Source             string        `json:"source"`
	Entities           TweetEntities `json:"entities"`
	DisplayTextFromIdx *int
	DisplayTextToIdx   *int
	FavoriteCount      int            `json:"favorite_count,string"`
	Truncated          bool           `json:"truncated"`
	RetweetCount       int            `json:"retweet_count,string"`
	PossiblySensitive  bool           `json:"possibly_sensitive"`
	Created            types.DateTime `json:"created_at"`
	Favorited          bool           `json:"favorited"`
	FullText           string         `json:"full_text"`
	Lang               string         `json:"lang"`
	InReplyToUserID    *int
	InReplyToUser      *User
	InReplyToStatusID  *int
	InReplyToStatus    *Tweet
}

func (Tweet) TableName

func (Tweet) TableName() string

func (*Tweet) UnmarshalJSON

func (t *Tweet) UnmarshalJSON(b []byte) error

type TweetEntities

type TweetEntities struct {
	gorm.Model
	TweetID  int            `gorm:"unique"`
	Hashtags []TweetHashtag `json:"hashtags"`
	Media    []TweetMedia   `json:"media"`
	//Symbols      []Symbol       `json:"symbols"`
	UserMentions []TweetUserMention `json:"user_mentions"`
	URLs         []TweetURL         `json:"urls"`
}

func (TweetEntities) TableName

func (TweetEntities) TableName() string

type TweetHashtag

type TweetHashtag struct {
	gorm.Model
	TweetEntitiesID int `gorm:"uniqueIndex:twitter_tweet_hashtags_key"`
	HashtagID       int `gorm:"uniqueIndex:twitter_tweet_hashtags_key"`
	Hashtag         Hashtag
	FromIdx         *int `gorm:"uniqueIndex:twitter_tweet_hashtags_key"`
	ToIdx           *int `gorm:"uniqueIndex:twitter_tweet_hashtags_key"`
}

func (TweetHashtag) TableName

func (TweetHashtag) TableName() string

func (*TweetHashtag) UnmarshalJSON

func (th *TweetHashtag) UnmarshalJSON(b []byte) error

type TweetMedia

type TweetMedia struct {
	gorm.Model
	ID              int    `json:"id,string" gorm:"uniqueIndex:twitter_tweet_media_key"`
	TweetEntitiesID int    `gorm:"uniqueIndex:twitter_tweet_media_key"`
	ExpandedURL     string `json:"expanded_url"`
	FromIdx         *int   `gorm:"uniqueIndex:twitter_tweet_media_key"`
	ToIdx           *int   `gorm:"uniqueIndex:twitter_tweet_media_key"`
	URL             string `json:"url"`
	MediaURL        string `json:"media_url"`
	MediaURLHTTPS   string `json:"media_url_https"`
	//Sizes           struct {
	//	Thumb struct {
	//		W      string `json:"w"`
	//		H      string `json:"h"`
	//		Resize string `json:"resize"`
	//	} `json:"thumb"`
	//	Small struct {
	//		W      string `json:"w"`
	//		H      string `json:"h"`
	//		Resize string `json:"resize"`
	//	} `json:"small"`
	//	Large struct {
	//		W      string `json:"w"`
	//		H      string `json:"h"`
	//		Resize string `json:"resize"`
	//	} `json:"large"`
	//	Medium struct {
	//		W      string `json:"w"`
	//		H      string `json:"h"`
	//		Resize string `json:"resize"`
	//	} `json:"medium"`
	//} `json:"sizes"`
	Type       string `json:"type"`
	DisplayURL string `json:"display_url"`
}

func (TweetMedia) TableName

func (TweetMedia) TableName() string

func (*TweetMedia) UnmarshalJSON

func (tm *TweetMedia) UnmarshalJSON(b []byte) error

type TweetURL

type TweetURL struct {
	gorm.Model
	TweetEntitiesID int `gorm:"uniqueIndex:twitter_tweet_urls_key"`
	URLID           int `gorm:"uniqueIndex:twitter_tweet_urls_key"`
	URL             URL
	FromIdx         *int `gorm:"uniqueIndex:twitter_tweet_urls_key"`
	ToIdx           *int `gorm:"uniqueIndex:twitter_tweet_urls_key"`
}

func (TweetURL) TableName

func (TweetURL) TableName() string

func (*TweetURL) UnmarshalJSON

func (tu *TweetURL) UnmarshalJSON(b []byte) error

type TweetUserMention

type TweetUserMention struct {
	gorm.Model
	TweetEntitiesID int `gorm:"uniqueIndex:twitter_tweet_user_mentions_key"`
	UserID          int `gorm:"uniqueIndex:twitter_tweet_user_mentions_key"`
	User            User
	FromIdx         *int `gorm:"uniqueIndex:twitter_tweet_user_mentions_key"`
	ToIdx           *int `gorm:"uniqueIndex:twitter_tweet_user_mentions_key"`
}

func (TweetUserMention) TableName

func (TweetUserMention) TableName() string

func (*TweetUserMention) UnmarshalJSON

func (tum *TweetUserMention) UnmarshalJSON(b []byte) error

type URL

type URL struct {
	gorm.Model
	URL      string `json:"url" gorm:"unique"`
	Expanded string `json:"expanded"`
	Display  string `json:"display"`
}

func (URL) TableName

func (URL) TableName() string

type User

type User struct {
	gorm.Model
	ID         int    `json:"id,string"`
	Name       string `json:"name"`
	ScreenName string `json:"screen_name"`
}

func (User) TableName

func (User) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL