repository

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

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 Owner

type Owner struct {
	Name      string `bson:"name"`
	AvatarURL string `bson:"avatarURL"`
}

Owner represents the owner of a repository

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

type VimColorSchemeGroup struct {
	Name    string `bson:"name"`
	HexCode string `bson:"hexCode"`
}

VimColorSchemeGroup represents a vim color scheme group's data

Jump to

Keyboard shortcuts

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