Documentation
¶
Index ¶
- func UniquifyRepositories(repositories []*gogithub.Repository) []*gogithub.Repository
- type Owner
- type Repository
- func (repository Repository) AppendToStargazersCountHistory() []StargazersCountHistoryItem
- func (repository *Repository) AssignRepositoryType()
- func (repository Repository) ComputeTrendingStargazersCount(dayCount int) int
- func (repository Repository) IsValidAfterGenerate() bool
- func (repository Repository) IsValidAfterUpdate() bool
- func (repository *Repository) SyncVimColorSchemes(vimColorSchemes []VimColorScheme)
- type StargazersCountHistoryItem
- type VimBackgroundValue
- type VimColorScheme
- type VimColorSchemeData
- type VimColorSchemeGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UniquifyRepositories ¶
func UniquifyRepositories(repositories []*gogithub.Repository) []*gogithub.Repository
UniquifyRepositories makes sure no repository is listed twice in a list
Types ¶
type Repository ¶
type Repository struct {
ID int64 `bson:"_id,omitempty"`
Owner Owner `bson:"owner"`
Name string `bson:"name"`
GitHubURL string `bson:"githubURL"`
HomepageURL string `bson:"homepageURL"`
StargazersCount int `bson:"stargazersCount"`
StargazersCountHistory []StargazersCountHistoryItem `bson:"stargazersCountHistory"`
WeekStargazersCount int `bson:"weekStargazersCount"`
License string `bson:"license"`
Size int `bson:"size"`
GitHubCreatedAt time.Time `bson:"githubCreatedAt"`
LastCommitAt time.Time `bson:"lastCommitAt"`
VimColorSchemes []VimColorScheme `bson:"vimColorSchemes,omitempty"`
IsVim bool `bson:"isVim"`
IsLua bool `bson:"isLua"`
UpdateValid bool `bson:"updateValid"`
UpdatedAt time.Time `bson:"updatedAt"`
GenerateValid bool `bson:"generateValid"`
GeneratedAt time.Time `bson:"generatedAt"`
}
Repository represents a repository as it's stored in the database
func (Repository) AppendToStargazersCountHistory ¶
func (repository Repository) AppendToStargazersCountHistory() []StargazersCountHistoryItem
AppendToStargazersCountHistory appends today's item to the stargazers count history
func (*Repository) AssignRepositoryType ¶
func (repository *Repository) AssignRepositoryType()
AssignRepositoryType defines is a repository is vim, lua, or both
func (Repository) ComputeTrendingStargazersCount ¶
func (repository Repository) ComputeTrendingStargazersCount(dayCount int) int
ComputeTrendingStargazersCount adds up the stargazers counts from the last days
func (Repository) IsValidAfterGenerate ¶
func (repository Repository) IsValidAfterGenerate() bool
IsValidAfterGenerate returns true if a repository is considered valid from our standards after a generate job
func (Repository) IsValidAfterUpdate ¶
func (repository Repository) IsValidAfterUpdate() bool
IsValidAfterUpdate returns true if a repository is considered valid from our standards after an update job
func (*Repository) SyncVimColorSchemes ¶
func (repository *Repository) SyncVimColorSchemes(vimColorSchemes []VimColorScheme)
SyncVimColorSchemes replaces the vim color scheme list of a repository with a new one while keeping as much data from the old list as possible
type StargazersCountHistoryItem ¶
type StargazersCountHistoryItem struct {
Date time.Time `bson:"date"`
StargazersCount int `bson:"stargazersCount"`
}
StargazersCountHistoryItem represents a repository's stargazers count at a given date
type VimBackgroundValue ¶
type VimBackgroundValue string
VimBackgroundValue sets up an enum containing the possible values for background in vim
const ( // LightBackground represents light background value for vim LightBackground VimBackgroundValue = "light" // DarkBackground represents light background value for vim DarkBackground VimBackgroundValue = "dark" )
type VimColorScheme ¶
type VimColorScheme struct {
FileURL string `bson:"fileURL"`
Name string `bson:"name"`
Data VimColorSchemeData `bson:"data"`
Valid bool `bson:"valid"`
Backgrounds []string `bson:"backgrounds"`
IsLua bool `bson:"isLua"`
LastCommitAt time.Time `bson:"lastCommitAt"`
}
VimColorScheme represents a vim color scheme's meta data
type VimColorSchemeData ¶
type VimColorSchemeData struct {
Light []VimColorSchemeGroup `bson:"light,omitempty"`
Dark []VimColorSchemeGroup `bson:"dark,omitempty"`
}
VimColorSchemeData represents the color values for light and dark backgrounds
type VimColorSchemeGroup ¶
VimColorSchemeGroup represents a vim color scheme group's data