Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reading ¶
type Reading struct { Authors []*ReadingAuthor `toml:"authors"` ID int `toml:"id"` ISBN string `toml:"isbn"` ISBN13 string `toml:"isbn13"` NumPages int `toml:"num_pages"` PublishedYear int `toml:"published_year"` ReadAt time.Time `toml:"read_at"` Rating int `toml:"rating"` Review string `toml:"review"` ReviewHTML template.HTML `toml:"-"` ReviewID int `toml:"review_id"` Title string `toml:"title"` // AuthorsDisplay is just the names of all authors combined together for // display on a page. AuthorsDisplay string `toml:"-"` }
Reading is a single Goodreads book stored to a TOML file.
type ReadingAuthor ¶
ReadingAuthor is a single Goodreads author stored to a TOML file.
func (*ReadingAuthor) UnmarshalText ¶
func (a *ReadingAuthor) UnmarshalText(data []byte) error
Only kicks in if the author value is a single string. Otherwise the full object is unmarshaled into the struct.
type ReadingDB ¶
type ReadingDB struct {
Readings []*Reading `toml:"readings"`
}
ReadingDB is a database of Goodreads readings stored to a TOML file.
type Tweet ¶
type Tweet struct { CreatedAt time.Time `toml:"created_at"` Entities *TweetEntities `toml:"entities"` FavoriteCount int `toml:"favorite_count"` ID int64 `toml:"id"` Reply *TweetReply `toml:"reply"` Retweet *TweetRetweet `toml:"retweet"` RetweetCount int `toml:"retweet_count"` Text string `toml:"text"` // Images are the URLs of all images associated with a given tweet, if // any. Images []TweetImage `toml:"-"` // ReplyOrMention is assigned to tweets which are either a direct mention // or reply, and which therefore don't go in the main timeline. It gives us // an easy way to access this information from a template. ReplyOrMention bool `toml:"-"` // TextHTML is Text rendered to HTML using a variety of special Twitter // rules. It's rendered once and added to the struct so that it can be // reused across multiple pages. TextHTML template.HTML `toml:"-"` }
Tweet is a single tweet stored to a TOML file.
type TweetDB ¶
type TweetDB struct {
Tweets []*Tweet `toml:"tweets"`
}
TweetDB is a database of tweets stored to a TOML file.
type TweetEntities ¶
type TweetEntities struct { Medias []*TweetEntitiesMedia `toml:"medias"` URLs []*TweetEntitiesURL `toml:"urls"` UserMentions []*TweetEntitiesUserMention `toml:"user_mentions"` }
TweetEntities contains various multimedia entries that may be contained in a tweet.
type TweetEntitiesMedia ¶
type TweetEntitiesMedia struct { ID int64 `toml:"id"` Type string `toml:"type"` URL string `toml:"url"` // contains filtered or unexported fields }
TweetEntitiesMedia is an image or video stored in a tweet.
func (*TweetEntitiesMedia) OriginalExt ¶
func (p *TweetEntitiesMedia) OriginalExt() string
type TweetEntitiesURL ¶
type TweetEntitiesURL struct { DisplayURL string `toml:"display_url"` ExpandedURL string `toml:"expanded_url"` URL string `toml:"url"` }
TweetEntitiesURL is a URL referenced in a tweet.
type TweetEntitiesUserMention ¶
TweetEntitiesUserMention is another user being mentioned in a tweet.
type TweetImage ¶
type TweetMonth ¶
TweetMonth holds a collection of tweets grouped by year.
type TweetMonthCount ¶
func GetTwitterByMonth ¶
func GetTwitterByMonth(tweets []*Tweet) []*TweetMonthCount
type TweetReply ¶
type TweetReply struct { StatusID int64 `toml:"status_id"` User string `toml:"user"` UserID int64 `toml:"user_id"` }
TweetReply is populated with reply information for when a tweet is a reply.
type TweetRetweet ¶
type TweetRetweet struct { StatusID int64 `toml:"status_id"` User string `toml:"user"` UserID int64 `toml:"user_id"` }
TweetRetweet is populated with retweet information for when a tweet is a retweet.
type TweetYear ¶
type TweetYear struct { Year int Months []*TweetMonth }
TweetYear holds a collection of tweetMonths grouped by year.