Documentation ¶
Index ¶
- func IsNotFound(err error) bool
- type Database
- type GitBurndown
- type RepoMD
- type ReposDatabase
- func (r *ReposDatabase) DeleteGitBurndownResults(ctx context.Context, repoID int) error
- func (r *ReposDatabase) DeleteRepository(ctx context.Context, id int) error
- func (r *ReposDatabase) GetFilesBurndown(ctx context.Context, repoID int, filename string) ([]*models.FileBurndownEntry, error)
- func (r *ReposDatabase) GetGlobalBurndown(ctx context.Context, repoID int) ([]*models.BurndownEntry, error)
- func (r *ReposDatabase) GetRepositories(ctx context.Context, h host.Host, owner string) ([]*models.Repository, error)
- func (r *ReposDatabase) GetRepository(ctx context.Context, h host.Host, owner, name string) (*models.Repository, error)
- func (r *ReposDatabase) InsertGitBurndownResult(ctx context.Context, repoID int, m *analysis.GitRepoMeta, ...) error
- func (r *ReposDatabase) InsertHostItems(ctx context.Context, h host.Host, repoID int, items []*host.Item) error
- func (r *ReposDatabase) NewRepository(ctx context.Context, installation string, repo host.Repo) error
- func (r *ReposDatabase) UpdateRepository(ctx context.Context, id int, meta RepoMD) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound checks if the given errors is a database result-not-found error
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is a low-level wrapper around the database driver
func (*Database) Repos ¶
func (db *Database) Repos() *ReposDatabase
Repos instantaite a new ReposDatabase client
type GitBurndown ¶
type GitBurndown struct { ID int RepoID int Month string Global int Files map[string]int People map[string]int }
GitBurndown represents one sample per entry
type RepoMD ¶
type RepoMD struct {
Description string
}
RepoMD is additional information to include about a repository. Since a lot of stuff isn't include in the initial installation event, this is a separate update.
type ReposDatabase ¶
type ReposDatabase struct {
// contains filtered or unexported fields
}
ReposDatabase is a client for accessing repository-related databases
func (*ReposDatabase) DeleteGitBurndownResults ¶
func (r *ReposDatabase) DeleteGitBurndownResults(ctx context.Context, repoID int) error
DeleteGitBurndownResults deletes all git burndown results associated with the given repository ID. TODO: should this be done? see https://github.com/bobheadxi/timelines/issues/44
func (*ReposDatabase) DeleteRepository ¶
func (r *ReposDatabase) DeleteRepository(ctx context.Context, id int) error
DeleteRepository removes a repository and associated items
func (*ReposDatabase) GetFilesBurndown ¶
func (r *ReposDatabase) GetFilesBurndown( ctx context.Context, repoID int, filename string, ) ([]*models.FileBurndownEntry, error)
GetFilesBurndown returns files
func (*ReposDatabase) GetGlobalBurndown ¶
func (r *ReposDatabase) GetGlobalBurndown( ctx context.Context, repoID int, ) ([]*models.BurndownEntry, error)
GetGlobalBurndown retrieves global burndowns for the given repo TODO: one at a time? all at once?
func (*ReposDatabase) GetRepositories ¶
func (r *ReposDatabase) GetRepositories(ctx context.Context, h host.Host, owner string) ([]*models.Repository, error)
GetRepositories fetches all repositories associated with the given owner
func (*ReposDatabase) GetRepository ¶
func (r *ReposDatabase) GetRepository( ctx context.Context, h host.Host, owner, name string, ) (*models.Repository, error)
GetRepository fetches a specific repository
func (*ReposDatabase) InsertGitBurndownResult ¶
func (r *ReposDatabase) InsertGitBurndownResult( ctx context.Context, repoID int, m *analysis.GitRepoMeta, bd *analysis.BurndownResult, ) error
InsertGitBurndownResult processes a burndown analysis for insertion
func (*ReposDatabase) InsertHostItems ¶
func (r *ReposDatabase) InsertHostItems( ctx context.Context, h host.Host, repoID int, items []*host.Item, ) error
InsertHostItems executes a batch insert on all given items
func (*ReposDatabase) NewRepository ¶
func (r *ReposDatabase) NewRepository( ctx context.Context, installation string, repo host.Repo, ) error
NewRepository creates a new repository entry
func (*ReposDatabase) UpdateRepository ¶
UpdateRepository updates a given repository