Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound is a not found error
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface {
DBReader
DBWriter
// Close the database
Close() error
// Initialize the database
Initialize(context.Context) error
}
DB is the tally database
type DBReader ¶
type DBReader interface {
// GetChecks retrieves check scores for a repository. Returns
// ErrNotFound if no checks are found.
GetChecks(context.Context, string) ([]Check, error)
// GetRepositories returns any repositories associated with the package
// indicated by system and name. Returns ErrNotFound if there are no matching
// repositories.
GetRepositories(context.Context, string, string) ([]string, error)
// GetScore retrieves scorecard scores for a list of repositories
GetScores(context.Context, ...string) ([]Score, error)
}
DBReader reads from the database
type DBWriter ¶
type DBWriter interface {
// AddChecks adds scorecard check scores to the database. If there's
// already a check in the database for the repository in question then
// the existing check will be updated.
AddChecks(context.Context, ...Check) error
// AddPackages adds packages to the database. The same package+system
// combination can have multiple repositories associated with it.
AddPackages(context.Context, ...Package) error
// AddScores adds scorecard scores to the database. If there's already
// a score in the database for the repository in question, then the
// existing score will be updated.
AddScores(context.Context, ...Score) error
}
DBWriter writes to the database
Click to show internal directories.
Click to hide internal directories.