Documentation ¶
Index ¶
- func CreateOrUpdateStar(db *gorm.DB, star *Star, service *Service) (bool, error)
- func FindLanguages(db *gorm.DB) ([]string, error)
- func InitDB(filepath string, verbose bool) (*gorm.DB, error)
- func InitIndex(filepath string) (bleve.Index, error)
- type Service
- type Star
- func FindStarByID(db *gorm.DB, ID uint) (*Star, error)
- func FindStars(db *gorm.DB, match string) ([]Star, error)
- func FindStarsByLanguage(db *gorm.DB, match string, language string) ([]Star, error)
- func FindStarsByLanguageAndOrTag(db *gorm.DB, match string, language string, tagName string, union bool) ([]Star, error)
- func FindUntaggedStars(db *gorm.DB, match string) ([]Star, error)
- func FuzzyFindStarsByName(db *gorm.DB, name string) ([]Star, error)
- func NewStarFromGithub(timestamp *github.Timestamp, star github.Repository) (*Star, error)
- func NewStarFromGitlab(star gitlab.Project) (*Star, error)
- func (star *Star) AddTag(db *gorm.DB, tag *Tag) error
- func (star *Star) HasTag(tag *Tag) bool
- func (star *Star) Index(index bleve.Index, db *gorm.DB) error
- func (star *Star) LoadTags(db *gorm.DB) error
- func (star *Star) RemoveAllTags(db *gorm.DB) error
- func (star *Star) RemoveTag(db *gorm.DB, tag *Tag) error
- type StarResult
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateStar ¶
CreateOrUpdateStar creates or updates a star and returns true if the star was created (vs updated)
func FindLanguages ¶
FindLanguages finds all languages
Types ¶
type Star ¶
type Star struct { gorm.Model RemoteID string Name *string FullName *string Description *string Homepage *string URL *string Language *string Stargazers int StarredAt time.Time ServiceID uint Tags []Tag `gorm:"many2many:star_tags;"` }
Star represents a starred repository
func FindStarByID ¶ added in v0.2.0
FindStarByID finds a star by ID
func FindStarsByLanguage ¶
FindStarsByLanguage finds stars with the specified language
func FindStarsByLanguageAndOrTag ¶ added in v0.4.0
func FindStarsByLanguageAndOrTag(db *gorm.DB, match string, language string, tagName string, union bool) ([]Star, error)
FindStarsByLanguageAndOrTag finds stars with the specified language and/or the specified tag
func FindUntaggedStars ¶ added in v0.4.0
FindUntaggedStars finds stars without any tags
func FuzzyFindStarsByName ¶
FuzzyFindStarsByName finds stars with approximate matching for full name and name
func NewStarFromGithub ¶
NewStarFromGithub creates a Star from a Github star
func NewStarFromGitlab ¶ added in v0.4.0
NewStarFromGitlab creates a Star from a Gitlab star
func (*Star) HasTag ¶
HasTag returns whether a star has a tag. Note that you must call LoadTags first -- no reason to incur a database call each time
func (*Star) RemoveAllTags ¶
RemoveAllTags removes all tags for a star
type StarResult ¶
StarResult wraps a star and an error
type Tag ¶
Tag represents a tag in the database
func FindOrCreateTagByName ¶
FindOrCreateTagByName finds a tag by name, creating if it doesn't exist
func FindTagByName ¶
FindTagByName finds a tag by name