Documentation
¶
Index ¶
- Constants
- func AddRepo(r *Repository) (err error)
- func AddReport(r *Report) (err error)
- func HasReport(repoID string, commit string) bool
- func SetupEngine() *xorm.Engine
- func SetupTestEngine()
- func UpdateIssues(r *Report) (err error)
- func UpdateRepo(r *Repository) (err error)
- func UpdateReport(r *Report) (err error)
- type Issue
- type Report
- type ReportStatus
- type Repository
Constants ¶
const ( // InProgress is when the report generation is in-progress. InProgress = iota // Complete is when the report generation is complete. Complete // Failed is when the report generation failed. Failed )
Variables ¶
This section is empty.
Functions ¶
func AddRepo ¶
func AddRepo(r *Repository) (err error)
AddRepo adds a new Repository to the database. It returns the columns affected and error (if exists).
func SetupEngine ¶
SetupEngine sets up the xorm engine according to the database configuration, and syncs the schema.
func SetupTestEngine ¶
func SetupTestEngine()
func UpdateIssues ¶
UpdateIssues updates or inserts the issues of a report in the database.
func UpdateRepo ¶
func UpdateRepo(r *Repository) (err error)
UpdateRepo updates a Repository in the database. It returns the columns affected and error (if exists).
func UpdateReport ¶
UpdateReport updates an existing report in the database. Returns an error if fails.
Types ¶
type Issue ¶
type Issue struct {
IssueID int `xorm:"autoincr pk"`
ReportID int64 `xorm:"notnull"`
CheckName string `xorm:"varchar(16) notnull"`
FilePath string `xorm:"varchar(32) notnull"`
LineNumber int `xorm:"null"`
ColumnNumber int `xorm:"null"`
Description string `xorm:"varchar(128) notnull"`
SourceSnippet string `xorm:"text null"`
}
Issue represents a single issue, which is usually a part of a Report along with other Issues.
type Report ¶
type Report struct {
ReportID int64 `xorm:"pk autoincr"`
RepositoryID string `xorm:"varchar(64) notnull"`
Commit string `xorm:"index varchar(40) notnull"`
Status ReportStatus `xorm:"notnull"`
CreatedUnix int64 `xorm:"created"`
Issues []*Issue `xorm:"-"`
}
Report represents a report of a specific commit of a project.
func (*Report) LoadIssues ¶
LoadIssues loads all issues in a report.
type ReportStatus ¶
type ReportStatus int
ReportStatus represents the generation status of a report.
type Repository ¶
type Repository struct {
RepoID string `xorm:"varchar(64) pk"`
IssueID int `xorm:"null"` // stored id of the main issue for checkstyle report
SecretKey string `xorm:"varchar(32) null"`
LatestCommit string `xorm:"varchar(40) null"`
Reports []*Report `xorm:"-"`
}
Repository represents a specific GitLab project. It keeps track of the issue tracker post and all the reports of that specific repository.
func GetRepo ¶
func GetRepo(id string) (*Repository, error)
GetRepo returns the repository from the project ID. It returns the repository and error (if exists).