Documentation
¶
Index ¶
- Variables
- func SvgPolylineCoordsFromYValues(width float64, height float64, values []float64) string
- type AppRelease
- type AppReleases
- type Calendar
- type ForumPost
- type ForumPosts
- type GithubTicket
- type PlaceJson
- type PlacesResponseJson
- type RSSFeedItem
- type RSSFeedItems
- type RSSFeedRequest
- type RepositoryDetails
- type RequestDoer
- type SiteStatus
- type Stock
- type Stocks
- type TwitchCategory
- type TwitchChannel
- type TwitchChannels
- type Video
- type Videos
- type Weather
- type WeatherResponseJson
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoContent = errors.New("failed to retrieve any content") ErrPartialContent = errors.New("failed to retrieve some of the content") )
Functions ¶
Types ¶
type AppRelease ¶
type AppReleases ¶
type AppReleases []AppRelease
func FetchLatestReleasesFromGithub ¶
func FetchLatestReleasesFromGithub(repositories []string, token string) (AppReleases, error)
func (AppReleases) SortByNewest ¶
func (r AppReleases) SortByNewest() AppReleases
type Calendar ¶
type Calendar struct {
CurrentDay int
CurrentWeekNumber int
CurrentMonthName string
CurrentYear int
Days []int
}
func NewCalendar ¶
TODO: very inflexible, refactor to allow more customizability TODO: allow changing first day of week TODO: allow changing between showing the previous and next week and the entire month
type ForumPost ¶
type ForumPost struct {
Title string
DiscussionUrl string
TargetUrl string
TargetUrlDomain string
ThumbnailUrl string
CommentCount int
Score int
Engagement float64
TimePosted time.Time
}
func (*ForumPost) HasTargetUrl ¶
type ForumPosts ¶
type ForumPosts []ForumPost
func FetchHackerNewsPosts ¶
func FetchHackerNewsPosts(sort string, limit int, commentsUrlTemplate string) (ForumPosts, error)
func FetchSubredditPosts ¶
func FetchSubredditPosts(subreddit, sort, topPeriod, search, commentsUrlTemplate, requestUrlTemplate string) (ForumPosts, error)
func (ForumPosts) CalculateEngagement ¶
func (p ForumPosts) CalculateEngagement()
func (ForumPosts) FilterPostedBefore ¶
func (p ForumPosts) FilterPostedBefore(postedBefore time.Duration) []ForumPost
func (ForumPosts) SortByEngagement ¶
func (p ForumPosts) SortByEngagement()
type PlaceJson ¶
type PlaceJson struct {
Name string
Area string `json:"admin1"`
Latitude float64
Longitude float64
Timezone string
Country string
// contains filtered or unexported fields
}
func FetchPlaceFromName ¶
type PlacesResponseJson ¶
type PlacesResponseJson struct {
Results []PlaceJson
}
type RSSFeedItem ¶
type RSSFeedItems ¶
type RSSFeedItems []RSSFeedItem
func GetItemsFromRSSFeeds ¶
func GetItemsFromRSSFeeds(requests []RSSFeedRequest) (RSSFeedItems, error)
func (RSSFeedItems) SortByNewest ¶
func (f RSSFeedItems) SortByNewest() RSSFeedItems
type RSSFeedRequest ¶
type RepositoryDetails ¶
type RepositoryDetails struct {
Name string
Stars int
Forks int
OpenPullRequests int
PullRequests []GithubTicket
OpenIssues int
Issues []GithubTicket
}
type SiteStatus ¶
func FetchStatusesForRequests ¶
func FetchStatusesForRequests(requests []*http.Request) ([]SiteStatus, error)
type Stocks ¶
type Stocks []Stock
func (Stocks) SortByAbsChange ¶
func (t Stocks) SortByAbsChange()
type TwitchCategory ¶
type TwitchCategory struct {
Slug string `json:"slug"`
Name string `json:"name"`
AvatarUrl string `json:"avatarURL"`
ViewersCount int `json:"viewersCount"`
Tags []struct {
Name string `json:"tagName"`
} `json:"tags"`
GameReleaseDate string `json:"originalReleaseDate"`
IsNew bool `json:"-"`
}
func FetchTopGamesFromTwitch ¶
func FetchTopGamesFromTwitch(exclude []string, limit int) ([]TwitchCategory, error)
type TwitchChannel ¶
type TwitchChannels ¶
type TwitchChannels []TwitchChannel
func FetchChannelsFromTwitch ¶
func FetchChannelsFromTwitch(channelLogins []string) (TwitchChannels, error)
func (TwitchChannels) SortByViewers ¶
func (channels TwitchChannels) SortByViewers()
type Weather ¶
type Weather struct {
Temperature int
ApparentTemperature int
WeatherCode int
CurrentColumn int
SunriseColumn int
SunsetColumn int
Columns []weatherColumn
}
func FetchWeatherForPlace ¶
TODO: bunch of spaget, refactor
func (*Weather) WeatherCodeAsString ¶
type WeatherResponseJson ¶
type WeatherResponseJson struct {
Daily struct {
Sunrise []int64 `json:"sunrise"`
Sunset []int64 `json:"sunset"`
} `json:"daily"`
Hourly struct {
Temperature []float64 `json:"temperature_2m"`
PrecipitationProbability []int `json:"precipitation_probability"`
} `json:"hourly"`
Current struct {
Temperature float64 `json:"temperature_2m"`
ApparentTemperature float64 `json:"apparent_temperature"`
WeatherCode int `json:"weather_code"`
} `json:"current"`
}
Click to show internal directories.
Click to hide internal directories.