Documentation
¶
Index ¶
- Constants
- func CanonicalPriority(value string) string
- func IsPostgres(target string) bool
- type Alert
- type Organization
- type Repository
- type Store
- func (s *Store) BeginRun(ctx context.Context, orgID int64) (int64, error)
- func (s *Store) Close() error
- func (s *Store) EnsureOrg(ctx context.Context, login, url string, githubID int64) (int64, error)
- func (s *Store) FinishRun(ctx context.Context, runID, orgID int64, status, message string, ...) error
- func (s *Store) Migrate(ctx context.Context, direction string, target *int64) (int64, error)
- func (s *Store) OpenAlerts(ctx context.Context) ([]Alert, error)
- func (s *Store) Organizations(ctx context.Context) ([]Organization, error)
- func (s *Store) ReplaceOpenAlerts(ctx context.Context, orgID int64, repoID *int64, alerts []Alert) error
- func (s *Store) ReplaceOpenAlertsWithProgress(ctx context.Context, orgID int64, repoID *int64, alerts []Alert, ...) error
- func (s *Store) Repositories(ctx context.Context) ([]Repository, error)
- func (s *Store) RepositoryAlerts(ctx context.Context, fullName string) ([]Alert, error)
- func (s *Store) UpsertRepository(ctx context.Context, r Repository) (int64, error)
Constants ¶
const LatestVersion int64 = 2
LatestVersion is the highest schema version shipped in this binary.
Variables ¶
This section is empty.
Functions ¶
func CanonicalPriority ¶
CanonicalPriority maps scanner-specific labels to the five labels shown by the application. Values that are not explicitly understood remain Unknown.
func IsPostgres ¶ added in v0.2.0
IsPostgres recognizes both PostgreSQL URL schemes. All other targets retain their existing SQLite filename/URI semantics.
Types ¶
type Alert ¶
type Alert struct {
ID, OrgID, RepositoryID, GitHubID int64
Org, Repository, Tool, RuleID, RuleName, Severity string
// Priority is the app's canonical priority. Severity is retained for
// backwards-compatible callers and contains the scanner-reported value.
Priority, ReportedSeverity, SeveritySource string
RepositoryURL string
RuleDescription, ToolVersion, ToolGUID string
Message, Ref, CommitSHA, AnalysisKey string
Environment, Category string
Tags []string
Path string
StartLine, EndLine, StartColumn, EndColumn int
URL string
CreatedAt, UpdatedAt time.Time
Open bool
}
type Organization ¶
type Repository ¶
type Store ¶
func Connect ¶ added in v0.2.0
Connect opens a database without applying migrations, for migration commands.
func OpenContext ¶ added in v0.2.0
func (*Store) Migrate ¶ added in v0.2.0
Migrate uses the same version history for automatic upgrades and explicit operations. A nil target means all pending upgrades or one downgrade.
func (*Store) Organizations ¶
func (s *Store) Organizations(ctx context.Context) ([]Organization, error)
func (*Store) ReplaceOpenAlerts ¶
func (*Store) ReplaceOpenAlertsWithProgress ¶
func (s *Store) ReplaceOpenAlertsWithProgress(ctx context.Context, orgID int64, repoID *int64, alerts []Alert, progress func(done, total int)) error
ReplaceOpenAlertsWithProgress reports rows written inside the transaction. Completion of the callback does not imply the transaction has committed.
func (*Store) Repositories ¶
func (s *Store) Repositories(ctx context.Context) ([]Repository, error)
func (*Store) RepositoryAlerts ¶
RepositoryAlerts returns only the current cached open alerts for one repository.