Documentation
¶
Index ¶
- Constants
- Variables
- func ColumnName(f entity.OrderByField) string
- func Connect(cfg util.Config) (*sqlx.DB, error)
- func CreateCursorParameters(params []any, fields []Field) []any
- func CreateCursorQuery(query string, fields []Field) string
- func CreateOrderString(order []entity.Order) string
- func EnableScheduler(cfg util.Config) error
- func EncodeCursor(opts ...NewCursor) (string, error)
- func GetBoolValue(v sql.NullBool) bool
- func GetDefaultOrder(order []entity.Order, by entity.OrderByField, direction entity.OrderDirection) []entity.Order
- func GetInt16Value(v sql.NullInt16) int16
- func GetInt64Value(v sql.NullInt64) int64
- func GetStringValue(v sql.NullString) string
- func GetTimeValue(v sql.NullTime) time.Time
- func GetUserTypeValue(v sql.NullInt64) entity.UserType
- func GetVersion(cfg util.Config) (string, error)
- func OrderDirectionStr(dir entity.OrderDirection) string
- func RunMigrations(cfg util.Config) error
- func TestConnection(cfg util.Config, backOff int) error
- type ActivityHasIssueRow
- type ActivityHasServiceRow
- type ActivityRow
- type BaseIssueRepositoryRow
- type BaseServiceRow
- type ComponentInstanceRow
- type ComponentRow
- type ComponentVersionIssueRow
- type ComponentVersionRow
- type DatabaseRow
- type Db
- type EvidenceRow
- type Field
- type GetIssuesByRow
- type GetServicesByRow
- type IssueAggregationsRow
- type IssueCountRow
- type IssueMatchChangeRow
- type IssueMatchEvidenceRow
- type IssueMatchRow
- type IssueRepositoryRow
- type IssueRepositoryServiceRow
- type IssueRow
- type IssueVariantRow
- type IssueVariantWithRepository
- type NamedStmt
- type NewCursor
- func WithComponent(order []entity.Order, c entity.Component, cv entity.ComponentVersion, ...) NewCursor
- func WithComponentInstance(order []entity.Order, ci entity.ComponentInstance) NewCursor
- func WithComponentVersion(order []entity.Order, cv entity.ComponentVersion, ...) NewCursor
- func WithIssue(order []entity.Order, issue entity.Issue, ivRating int64) NewCursor
- func WithIssueMatch(order []entity.Order, im entity.IssueMatch) NewCursor
- func WithService(order []entity.Order, s entity.Service, isc entity.IssueSeverityCounts) NewCursor
- func WithSupportGroup(order []entity.Order, sg entity.SupportGroup) NewCursor
- type OwnerRow
- type QuietDb
- func (qdb *QuietDb) Close() error
- func (qdb *QuietDb) Exec(query string, args ...interface{}) (sql.Result, error)
- func (qdb *QuietDb) Get(dest interface{}, query string, args ...interface{}) error
- func (qdb *QuietDb) GetDbInstance() *sql.DB
- func (qdb *QuietDb) PrepareNamed(query string) (NamedStmt, error)
- func (qdb *QuietDb) Preparex(query string) (Stmt, error)
- func (qdb *QuietDb) Query(query string, args ...interface{}) (SqlRows, error)
- func (qdb *QuietDb) QueryRow(query string, args ...interface{}) *sql.Row
- func (qdb *QuietDb) Select(dest interface{}, query string, args ...interface{}) error
- type RatingCount
- type RowComposite
- type ScannerRunRow
- type ServiceAggregationsRow
- type ServiceIssueVariantRow
- type ServiceRow
- type SqlDatabase
- func (s *SqlDatabase) AddComponentVersionToIssue(issueId int64, componentVersionId int64) error
- func (s *SqlDatabase) AddEvidenceToIssueMatch(issueMatchId int64, evidenceId int64) error
- func (s *SqlDatabase) AddIssueRepositoryToService(serviceId int64, issueRepositoryId int64, priority int64) error
- func (s *SqlDatabase) AddIssueToActivity(activityId int64, issueId int64) error
- func (s *SqlDatabase) AddOwnerToService(serviceId int64, userId int64) error
- func (s *SqlDatabase) AddServiceToActivity(activityId int64, serviceId int64) error
- func (s *SqlDatabase) AddServiceToSupportGroup(supportGroupId int64, serviceId int64) error
- func (s *SqlDatabase) AddUserToSupportGroup(supportGroupId int64, userId int64) error
- func (s *SqlDatabase) Autoclose() (bool, error)
- func (s *SqlDatabase) CloseConnection() error
- func (s *SqlDatabase) CompleteScannerRun(uuid string) (bool, error)
- func (s *SqlDatabase) ConnectDB(dbName string) error
- func (s *SqlDatabase) CountActivities(filter *entity.ActivityFilter) (int64, error)
- func (s *SqlDatabase) CountComponentInstances(filter *entity.ComponentInstanceFilter) (int64, error)
- func (s *SqlDatabase) CountComponentVersions(filter *entity.ComponentVersionFilter) (int64, error)
- func (s *SqlDatabase) CountComponentVulnerabilities(filter *entity.ComponentFilter) ([]entity.IssueSeverityCounts, error)
- func (s *SqlDatabase) CountComponents(filter *entity.ComponentFilter) (int64, error)
- func (s *SqlDatabase) CountEvidences(filter *entity.EvidenceFilter) (int64, error)
- func (s *SqlDatabase) CountIssueMatchChanges(filter *entity.IssueMatchChangeFilter) (int64, error)
- func (s *SqlDatabase) CountIssueMatches(filter *entity.IssueMatchFilter) (int64, error)
- func (s *SqlDatabase) CountIssueRatings(filter *entity.IssueFilter) (*entity.IssueSeverityCounts, error)
- func (s *SqlDatabase) CountIssueRepositories(filter *entity.IssueRepositoryFilter) (int64, error)
- func (s *SqlDatabase) CountIssueTypes(filter *entity.IssueFilter) (*entity.IssueTypeCounts, error)
- func (s *SqlDatabase) CountIssueVariants(filter *entity.IssueVariantFilter) (int64, error)
- func (s *SqlDatabase) CountIssues(filter *entity.IssueFilter) (int64, error)
- func (s *SqlDatabase) CountScannerRuns(filter *entity.ScannerRunFilter) (int, error)
- func (s *SqlDatabase) CountServices(filter *entity.ServiceFilter) (int64, error)
- func (s *SqlDatabase) CountSupportGroups(filter *entity.SupportGroupFilter) (int64, error)
- func (s *SqlDatabase) CountUsers(filter *entity.UserFilter) (int64, error)
- func (s *SqlDatabase) CreateActivity(activity *entity.Activity) (*entity.Activity, error)
- func (s *SqlDatabase) CreateComponent(component *entity.Component) (*entity.Component, error)
- func (s *SqlDatabase) CreateComponentInstance(componentInstance *entity.ComponentInstance) (*entity.ComponentInstance, error)
- func (s *SqlDatabase) CreateComponentVersion(componentVersion *entity.ComponentVersion) (*entity.ComponentVersion, error)
- func (s *SqlDatabase) CreateEvidence(evidence *entity.Evidence) (*entity.Evidence, error)
- func (s *SqlDatabase) CreateIssue(issue *entity.Issue) (*entity.Issue, error)
- func (s *SqlDatabase) CreateIssueMatch(issueMatch *entity.IssueMatch) (*entity.IssueMatch, error)
- func (s *SqlDatabase) CreateIssueMatchChange(imc *entity.IssueMatchChange) (*entity.IssueMatchChange, error)
- func (s *SqlDatabase) CreateIssueRepository(issueRepository *entity.IssueRepository) (*entity.IssueRepository, error)
- func (s *SqlDatabase) CreateIssueVariant(issueVariant *entity.IssueVariant) (*entity.IssueVariant, error)
- func (s *SqlDatabase) CreateScannerRun(scannerRun *entity.ScannerRun) (bool, error)
- func (s *SqlDatabase) CreateScannerRunComponentInstanceTracker(componentInstanceId int64, scannerRunUUID string) error
- func (s *SqlDatabase) CreateService(service *entity.Service) (*entity.Service, error)
- func (s *SqlDatabase) CreateSupportGroup(supportGroup *entity.SupportGroup) (*entity.SupportGroup, error)
- func (s *SqlDatabase) CreateUser(user *entity.User) (*entity.User, error)
- func (s *SqlDatabase) DeleteActivity(id int64, userId int64) error
- func (s *SqlDatabase) DeleteComponent(id int64, userId int64) error
- func (s *SqlDatabase) DeleteComponentInstance(id int64, userId int64) error
- func (s *SqlDatabase) DeleteComponentVersion(id int64, userId int64) error
- func (s *SqlDatabase) DeleteEvidence(id int64, userId int64) error
- func (s *SqlDatabase) DeleteIssue(id int64, userId int64) error
- func (s *SqlDatabase) DeleteIssueMatch(id int64, userId int64) error
- func (s *SqlDatabase) DeleteIssueMatchChange(id int64, userId int64) error
- func (s *SqlDatabase) DeleteIssueRepository(id int64, userId int64) error
- func (s *SqlDatabase) DeleteIssueVariant(id int64, userId int64) error
- func (s *SqlDatabase) DeleteService(id int64, userId int64) error
- func (s *SqlDatabase) DeleteSupportGroup(id int64, userId int64) error
- func (s *SqlDatabase) DeleteUser(id int64, userId int64) error
- func (s *SqlDatabase) DropSchema(name string) error
- func (s *SqlDatabase) FailScannerRun(uuid string, message string) (bool, error)
- func (s *SqlDatabase) GetActivities(filter *entity.ActivityFilter) ([]entity.Activity, error)
- func (s *SqlDatabase) GetAllActivityIds(filter *entity.ActivityFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllComponentCursors(filter *entity.ComponentFilter, order []entity.Order) ([]string, error)
- func (s *SqlDatabase) GetAllComponentIds(filter *entity.ComponentFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllComponentInstanceCursors(filter *entity.ComponentInstanceFilter, order []entity.Order) ([]string, error)
- func (s *SqlDatabase) GetAllComponentInstanceIds(filter *entity.ComponentInstanceFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllComponentVersionCursors(filter *entity.ComponentVersionFilter, order []entity.Order) ([]string, error)
- func (s *SqlDatabase) GetAllComponentVersionIds(filter *entity.ComponentVersionFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllEvidenceIds(filter *entity.EvidenceFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllIssueCursors(filter *entity.IssueFilter, order []entity.Order) ([]string, error)
- func (s *SqlDatabase) GetAllIssueIds(filter *entity.IssueFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllIssueMatchChangeIds(filter *entity.IssueMatchChangeFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllIssueMatchCursors(filter *entity.IssueMatchFilter, order []entity.Order) ([]string, error)
- func (s *SqlDatabase) GetAllIssueMatchIds(filter *entity.IssueMatchFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllIssueRepositoryIds(filter *entity.IssueRepositoryFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllIssueVariantIds(filter *entity.IssueVariantFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllServiceCursors(filter *entity.ServiceFilter, order []entity.Order) ([]string, error)
- func (s *SqlDatabase) GetAllServiceIds(filter *entity.ServiceFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllSupportGroupCursors(filter *entity.SupportGroupFilter, order []entity.Order) ([]string, error)
- func (s *SqlDatabase) GetAllSupportGroupIds(filter *entity.SupportGroupFilter) ([]int64, error)
- func (s *SqlDatabase) GetAllUserIds(filter *entity.UserFilter) ([]int64, error)
- func (s *SqlDatabase) GetCcrn(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetCluster(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetComponentCcrns(filter *entity.ComponentFilter) ([]string, error)
- func (s *SqlDatabase) GetComponentInstanceParent(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetComponentInstances(filter *entity.ComponentInstanceFilter, order []entity.Order) ([]entity.ComponentInstanceResult, error)
- func (s *SqlDatabase) GetComponentVersions(filter *entity.ComponentVersionFilter, order []entity.Order) ([]entity.ComponentVersionResult, error)
- func (s *SqlDatabase) GetComponents(filter *entity.ComponentFilter, order []entity.Order) ([]entity.ComponentResult, error)
- func (s *SqlDatabase) GetContainer(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetContext(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetDefaultIssuePriority() int64
- func (s *SqlDatabase) GetDefaultRepositoryName() string
- func (s *SqlDatabase) GetDomain(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetEvidences(filter *entity.EvidenceFilter) ([]entity.Evidence, error)
- func (s *SqlDatabase) GetIssueMatchChanges(filter *entity.IssueMatchChangeFilter) ([]entity.IssueMatchChange, error)
- func (s *SqlDatabase) GetIssueMatches(filter *entity.IssueMatchFilter, order []entity.Order) ([]entity.IssueMatchResult, error)
- func (s *SqlDatabase) GetIssueNames(filter *entity.IssueFilter) ([]string, error)
- func (s *SqlDatabase) GetIssueRepositories(filter *entity.IssueRepositoryFilter) ([]entity.IssueRepository, error)
- func (s *SqlDatabase) GetIssueVariants(filter *entity.IssueVariantFilter) ([]entity.IssueVariant, error)
- func (s *SqlDatabase) GetIssues(filter *entity.IssueFilter, order []entity.Order) ([]entity.IssueResult, error)
- func (s *SqlDatabase) GetIssuesWithAggregations(filter *entity.IssueFilter, order []entity.Order) ([]entity.IssueResult, error)
- func (s *SqlDatabase) GetNamespace(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetPod(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetProject(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetRegion(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetScannerRunTags() ([]string, error)
- func (s *SqlDatabase) GetScannerRuns(filter *entity.ScannerRunFilter) ([]entity.ScannerRun, error)
- func (s *SqlDatabase) GetServiceCcrns(filter *entity.ServiceFilter) ([]string, error)
- func (s *SqlDatabase) GetServiceDomains(filter *entity.ServiceFilter) ([]string, error)
- func (s *SqlDatabase) GetServiceIssueVariants(filter *entity.ServiceIssueVariantFilter) ([]entity.ServiceIssueVariant, error)
- func (s *SqlDatabase) GetServiceRegions(filter *entity.ServiceFilter) ([]string, error)
- func (s *SqlDatabase) GetServices(filter *entity.ServiceFilter, order []entity.Order) ([]entity.ServiceResult, error)
- func (s *SqlDatabase) GetServicesWithAggregations(filter *entity.ServiceFilter, order []entity.Order) ([]entity.ServiceResult, error)
- func (s *SqlDatabase) GetSupportGroupCcrns(filter *entity.SupportGroupFilter) ([]string, error)
- func (s *SqlDatabase) GetSupportGroups(filter *entity.SupportGroupFilter, order []entity.Order) ([]entity.SupportGroupResult, error)
- func (s *SqlDatabase) GetType(filter *entity.ComponentInstanceFilter) ([]string, error)
- func (s *SqlDatabase) GetUniqueUserIDs(filter *entity.UserFilter) ([]string, error)
- func (s *SqlDatabase) GetUserNames(filter *entity.UserFilter) ([]string, error)
- func (s *SqlDatabase) GetUsers(filter *entity.UserFilter) ([]entity.User, error)
- func (s *SqlDatabase) GetVersion() (string, error)
- func (s *SqlDatabase) GrantAccess(username string, database string, host string) error
- func (s *SqlDatabase) RemoveComponentVersionFromIssue(issueId int64, componentVersionId int64) error
- func (s *SqlDatabase) RemoveEvidenceFromIssueMatch(issueMatchId int64, evidenceId int64) error
- func (s *SqlDatabase) RemoveIssueFromActivity(activityId int64, issueId int64) error
- func (s *SqlDatabase) RemoveIssueRepositoryFromService(serviceId int64, issueRepositoryId int64) error
- func (s *SqlDatabase) RemoveOwnerFromService(serviceId int64, userId int64) error
- func (s *SqlDatabase) RemoveServiceFromActivity(activityId int64, serviceId int64) error
- func (s *SqlDatabase) RemoveServiceFromSupportGroup(supportGroupId int64, serviceId int64) error
- func (s *SqlDatabase) RemoveUserFromSupportGroup(supportGroupId int64, userId int64) error
- func (s *SqlDatabase) RunPostMigrations() error
- func (s *SqlDatabase) RunUpMigrations() error
- func (s *SqlDatabase) ScannerRunByUUID(uuid string) (*entity.ScannerRun, error)
- func (s *SqlDatabase) UpdateActivity(activity *entity.Activity) error
- func (s *SqlDatabase) UpdateComponent(component *entity.Component) error
- func (s *SqlDatabase) UpdateComponentInstance(componentInstance *entity.ComponentInstance) error
- func (s *SqlDatabase) UpdateComponentVersion(componentVersion *entity.ComponentVersion) error
- func (s *SqlDatabase) UpdateEvidence(evidence *entity.Evidence) error
- func (s *SqlDatabase) UpdateIssue(issue *entity.Issue) error
- func (s *SqlDatabase) UpdateIssueMatch(issueMatch *entity.IssueMatch) error
- func (s *SqlDatabase) UpdateIssueMatchChange(imc *entity.IssueMatchChange) error
- func (s *SqlDatabase) UpdateIssueRepository(issueRepository *entity.IssueRepository) error
- func (s *SqlDatabase) UpdateIssueVariant(issueVariant *entity.IssueVariant) error
- func (s *SqlDatabase) UpdateService(service *entity.Service) error
- func (s *SqlDatabase) UpdateSupportGroup(supportGroup *entity.SupportGroup) error
- func (s *SqlDatabase) UpdateUser(user *entity.User) error
- func (s *SqlDatabase) WaitPostMigrations() error
- type SqlRows
- type Stmt
- type SupportGroupRow
- type SupportGroupServiceRow
- type SupportGroupUserRow
- type Trace
- type TraceDb
- func (tdb *TraceDb) Close() error
- func (tdb *TraceDb) Exec(query string, args ...interface{}) (sql.Result, error)
- func (tdb *TraceDb) Get(dest interface{}, query string, args ...interface{}) error
- func (tdb *TraceDb) GetDbInstance() *sql.DB
- func (tdb *TraceDb) PrepareNamed(query string) (NamedStmt, error)
- func (tdb *TraceDb) Preparex(query string) (Stmt, error)
- func (tdb *TraceDb) Query(query string, args ...interface{}) (SqlRows, error)
- func (tdb *TraceDb) QueryRow(query string, args ...interface{}) *sql.Row
- func (tdb *TraceDb) Select(dest interface{}, query string, args ...interface{}) error
- type TraceNamedStmt
- type TraceSqlRows
- type TraceStmt
- type UserRow
Constants ¶
View Source
const ( FILTER_FORMAT_STR = " %s %s" OP_AND = "AND" OP_OR = "OR" ERROR_MSG_PREPARED_STMT = "Error while creating prepared statement." )
View Source
const PostMigrationProcedureRegistryTable = "post_migration_procedure_registry"
Variables ¶
View Source
var Migration fs.FS = &migrationFiles
Functions ¶
func ColumnName ¶
func ColumnName(f entity.OrderByField) string
func CreateCursorParameters ¶
func CreateCursorQuery ¶
func CreateOrderString ¶
func EnableScheduler ¶ added in v1.14.0
func EncodeCursor ¶
func GetBoolValue ¶
func GetDefaultOrder ¶
func GetDefaultOrder(order []entity.Order, by entity.OrderByField, direction entity.OrderDirection) []entity.Order
func GetInt16Value ¶
func GetInt64Value ¶
func GetStringValue ¶
func GetStringValue(v sql.NullString) string
func OrderDirectionStr ¶
func OrderDirectionStr(dir entity.OrderDirection) string
func RunMigrations ¶ added in v1.19.0
Types ¶
type ActivityHasIssueRow ¶
type ActivityHasIssueRow struct { ActivityId sql.NullInt64 `db:"activityhasissue_activity_id" json:"activity_id"` IssueId sql.NullInt64 `db:"activityhasissue_issue_id" json:"issue_id"` CreatedAt sql.NullTime `db:"activityhasissue_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"activityhasissue_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"activityhasissue_updated_at" json:"updated_at"` }
type ActivityHasServiceRow ¶
type ActivityHasServiceRow struct { ActivityId sql.NullInt64 `db:"activityhasservice_activity_id" json:"activity_id"` ServiceId sql.NullInt64 `db:"activityhasservice_service_id" json:"service_id"` CreatedAt sql.NullTime `db:"activityhasservice_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"activityhasservice_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"activityhasservice_updated_at" json:"updated_at"` }
type ActivityRow ¶
type ActivityRow struct { Id sql.NullInt64 `db:"activity_id" json:"id"` Status sql.NullString `db:"activity_status" json:"status"` CreatedAt sql.NullTime `db:"activity_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"activity_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"activity_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"activity_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"activity_updated_by" json:"updated_by"` }
func (*ActivityRow) AsActivity ¶
func (ar *ActivityRow) AsActivity() entity.Activity
func (*ActivityRow) FromActivity ¶
func (ar *ActivityRow) FromActivity(a *entity.Activity)
type BaseIssueRepositoryRow ¶
type BaseIssueRepositoryRow struct { Id sql.NullInt64 `db:"issuerepository_id"` Name sql.NullString `db:"issuerepository_name"` Url sql.NullString `db:"issuerepository_url"` CreatedAt sql.NullTime `db:"issuerepository_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"issuerepository_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuerepository_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuerepository_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"issuerepository_updated_by" json:"updated_by"` }
func (*BaseIssueRepositoryRow) AsBaseIssueRepository ¶
func (birr *BaseIssueRepositoryRow) AsBaseIssueRepository() entity.BaseIssueRepository
func (*BaseIssueRepositoryRow) AsIssueRepository ¶
func (barr *BaseIssueRepositoryRow) AsIssueRepository() entity.IssueRepository
type BaseServiceRow ¶
type BaseServiceRow struct { Id sql.NullInt64 `db:"service_id" json:"id"` CCRN sql.NullString `db:"service_ccrn" json:"ccrn"` Domain sql.NullString `db:"service_domain" json:"domain"` Region sql.NullString `db:"service_region" json:"region"` CreatedAt sql.NullTime `db:"service_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"service_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"service_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"service_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"service_updated_by" json:"updated_by"` }
func (*BaseServiceRow) AsBaseService ¶
func (bsr *BaseServiceRow) AsBaseService() entity.BaseService
func (*BaseServiceRow) AsService ¶
func (bsr *BaseServiceRow) AsService() entity.Service
type ComponentInstanceRow ¶
type ComponentInstanceRow struct { Id sql.NullInt64 `db:"componentinstance_id" json:"id"` CCRN sql.NullString `db:"componentinstance_ccrn" json:"ccrn"` Region sql.NullString `db:"componentinstance_region" json:"region"` Cluster sql.NullString `db:"componentinstance_cluster" json:"cluster"` Namespace sql.NullString `db:"componentinstance_namespace" json:"namespace"` Domain sql.NullString `db:"componentinstance_domain" json:"domain"` Project sql.NullString `db:"componentinstance_project" json:"project"` Pod sql.NullString `db:"componentinstance_pod" json:"pod"` Container sql.NullString `db:"componentinstance_container" json:"container"` Type sql.NullString `db:"componentinstance_type" json:"type"` ParentId sql.NullInt64 `db:"componentinstance_parent_id"` Context sql.NullString `db:"componentinstance_context" json:"context"` Count sql.NullInt16 `db:"componentinstance_count" json:"count"` ComponentVersionId sql.NullInt64 `db:"componentinstance_component_version_id"` ServiceId sql.NullInt64 `db:"componentinstance_service_id"` CreatedAt sql.NullTime `db:"componentinstance_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"componentinstance_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"componentinstance_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"componentinstance_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"componentinstance_updated_by" json:"udpated_by"` }
func (*ComponentInstanceRow) AsComponentInstance ¶
func (cir *ComponentInstanceRow) AsComponentInstance() entity.ComponentInstance
func (*ComponentInstanceRow) FromComponentInstance ¶
func (cir *ComponentInstanceRow) FromComponentInstance(ci *entity.ComponentInstance)
type ComponentRow ¶
type ComponentRow struct { Id sql.NullInt64 `db:"component_id" json:"id"` CCRN sql.NullString `db:"component_ccrn" json:"ccrn"` Type sql.NullString `db:"component_type" json:"type"` CreatedAt sql.NullTime `db:"component_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"component_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"component_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"component_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"component_updated_by" json:"updated_by"` }
func (*ComponentRow) AsComponent ¶
func (cr *ComponentRow) AsComponent() entity.Component
func (*ComponentRow) FromComponent ¶
func (cr *ComponentRow) FromComponent(c *entity.Component)
type ComponentVersionIssueRow ¶
type ComponentVersionIssueRow struct { ComponentVersionId sql.NullInt64 `db:"componentversionissue_component_version_id" json:"component_version_id"` IssueId sql.NullInt64 `db:"componentversionissue_issue_id" json:"issue_id"` CreatedAt sql.NullTime `db:"componentversionissue_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"componentversionissue_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"componentversionissue_updated_at" json:"updated_at"` }
type ComponentVersionRow ¶
type ComponentVersionRow struct { Id sql.NullInt64 `db:"componentversion_id" json:"id"` Version sql.NullString `db:"componentversion_version" json:"version"` Tag sql.NullString `db:"componentversion_tag" json:"tag"` Repository sql.NullString `db:"componentversion_repository" json:"repository"` Organization sql.NullString `db:"componentversion_organization" json:"organization"` ComponentId sql.NullInt64 `db:"componentversion_component_id"` CreatedAt sql.NullTime `db:"componentversion_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"componentversion_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"componentversion_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"componentversion_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"componentversion_updated_by" json:"updated_by"` }
func (*ComponentVersionRow) AsComponentVersion ¶
func (cvr *ComponentVersionRow) AsComponentVersion() entity.ComponentVersion
func (*ComponentVersionRow) FromComponentVersion ¶
func (cvr *ComponentVersionRow) FromComponentVersion(cv *entity.ComponentVersion)
type DatabaseRow ¶
type DatabaseRow interface { IssueRow | IssueCountRow | GetIssuesByRow | IssueMatchRow | IssueAggregationsRow | IssueVariantRow | BaseIssueRepositoryRow | IssueRepositoryRow | IssueVariantWithRepository | ComponentRow | ComponentInstanceRow | ComponentVersionRow | BaseServiceRow | ServiceRow | GetServicesByRow | ServiceAggregationsRow | ActivityRow | UserRow | EvidenceRow | OwnerRow | SupportGroupRow | SupportGroupServiceRow | ActivityHasIssueRow | ActivityHasServiceRow | IssueRepositoryServiceRow | IssueMatchChangeRow | ServiceIssueVariantRow | RatingCount | RowComposite }
type Db ¶ added in v1.17.0
type Db interface { Close() error Exec(query string, args ...interface{}) (sql.Result, error) Get(dest interface{}, query string, args ...interface{}) error GetDbInstance() *sql.DB Preparex(query string) (Stmt, error) PrepareNamed(query string) (NamedStmt, error) Select(dest interface{}, query string, args ...interface{}) error Query(query string, args ...interface{}) (SqlRows, error) QueryRow(query string, args ...interface{}) *sql.Row }
type EvidenceRow ¶
type EvidenceRow struct { Id sql.NullInt64 `db:"evidence_id" json:"id"` Description sql.NullString `db:"evidence_description" json:"description"` Type sql.NullString `db:"evidence_type" json:"type"` Vector sql.NullString `db:"evidence_vector" json:"vector"` Rating sql.NullString `db:"evidence_rating" json:"rating"` RAAEnd sql.NullTime `db:"evidence_raa_end" json:"raa_end"` User *UserRow `json:"user,omitempty"` UserId sql.NullInt64 `db:"evidence_author_id"` Activity *ActivityRow `json:"activity,omitempty"` ActivityId sql.NullInt64 `db:"evidence_activity_id"` CreatedAt sql.NullTime `db:"evidence_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"evidence_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"evidence_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"evidence_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"evidence_updated_by" json:"updated_by"` }
func (*EvidenceRow) AsEvidence ¶
func (er *EvidenceRow) AsEvidence() entity.Evidence
func (*EvidenceRow) FromEvidence ¶
func (er *EvidenceRow) FromEvidence(e *entity.Evidence)
type Field ¶
type Field struct { Name entity.OrderByField Value any Order entity.OrderDirection }
func DecodeCursor ¶
type GetIssuesByRow ¶
type GetIssuesByRow struct { IssueAggregationsRow IssueRow }
func (*GetIssuesByRow) AsIssue ¶
func (ibr *GetIssuesByRow) AsIssue() entity.Issue
func (*GetIssuesByRow) AsIssueWithAggregations ¶
func (ibr *GetIssuesByRow) AsIssueWithAggregations() entity.IssueWithAggregations
type GetServicesByRow ¶
type GetServicesByRow struct { ServiceAggregationsRow ServiceRow }
func (*GetServicesByRow) AsServiceWithAggregations ¶
func (sbr *GetServicesByRow) AsServiceWithAggregations() entity.ServiceWithAggregations
type IssueAggregationsRow ¶
type IssueAggregationsRow struct { Activities sql.NullInt64 `db:"agg_activities"` IssueMatches sql.NullInt64 `db:"agg_issue_matches"` AffectedServices sql.NullInt64 `db:"agg_affected_services"` ComponentVersions sql.NullInt64 `db:"agg_component_versions"` AffectedComponentInstances sql.NullInt64 `db:"agg_affected_component_instances"` EarliestTargetRemediationDate sql.NullTime `db:"agg_earliest_target_remediation_date"` EarliestDiscoveryDate sql.NullTime `db:"agg_earliest_discovery_date"` }
type IssueCountRow ¶
type IssueCountRow struct { Count sql.NullInt64 `db:"issue_count"` Value sql.NullString `db:"issue_value"` }
func (*IssueCountRow) AsIssueCount ¶
func (icr *IssueCountRow) AsIssueCount() entity.IssueCount
type IssueMatchChangeRow ¶
type IssueMatchChangeRow struct { Id sql.NullInt64 `db:"issuematchchange_id" json:"id"` IssueMatchId sql.NullInt64 `db:"issuematchchange_issue_match_id" json:"issue_match_id"` ActivityId sql.NullInt64 `db:"issuematchchange_activity_id" json:"activity_id"` Action sql.NullString `db:"issuematchchange_action" json:"action"` CreatedAt sql.NullTime `db:"issuematchchange_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"issuematchchange_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuematchchange_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuematchchange_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"issuematchchange_updated_by" json:"updated_by"` }
func (*IssueMatchChangeRow) AsIssueMatchChange ¶
func (imcr *IssueMatchChangeRow) AsIssueMatchChange() entity.IssueMatchChange
func (*IssueMatchChangeRow) FromIssueMatchChange ¶
func (imcr *IssueMatchChangeRow) FromIssueMatchChange(imc *entity.IssueMatchChange)
type IssueMatchEvidenceRow ¶
type IssueMatchEvidenceRow struct { EvidenceId sql.NullInt64 `db:"issuematchevidence_evidence_id" json:"evidence_id"` IssueMatchId sql.NullInt64 `db:"issuematchevidence_issue_match_id" json:"issue_match_id"` CreatedAt sql.NullTime `db:"issuematchevidence_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"issuematchevidence_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuematchevidence_updated_at" json:"updated_at"` }
type IssueMatchRow ¶
type IssueMatchRow struct { Id sql.NullInt64 `db:"issuematch_id" json:"id"` Status sql.NullString `db:"issuematch_status" json:"status"` Vector sql.NullString `db:"issuematch_vector" json:"vector"` Rating sql.NullString `db:"issuematch_rating" json:"rating"` UserId sql.NullInt64 `db:"issuematch_user_id" json:"user_id"` ComponentInstanceId sql.NullInt64 `db:"issuematch_component_instance_id" json:"component_instance_id"` IssueId sql.NullInt64 `db:"issuematch_issue_id" json:"issue_id"` RemediationDate sql.NullTime `db:"issuematch_remediation_date" json:"remediation_date"` TargetRemediationDate sql.NullTime `db:"issuematch_target_remediation_date" json:"target_remediation_date"` CreatedAt sql.NullTime `db:"issuematch_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"issuematch_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuematch_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuematch_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"issuematch_updated_by" json:"updated_by"` }
func (IssueMatchRow) AsIssueMatch ¶
func (imr IssueMatchRow) AsIssueMatch() entity.IssueMatch
func (*IssueMatchRow) FromIssueMatch ¶
func (imr *IssueMatchRow) FromIssueMatch(im *entity.IssueMatch)
type IssueRepositoryRow ¶
type IssueRepositoryRow struct { BaseIssueRepositoryRow IssueRepositoryServiceRow }
func (*IssueRepositoryRow) AsIssueRepository ¶
func (irr *IssueRepositoryRow) AsIssueRepository() entity.IssueRepository
func (*IssueRepositoryRow) FromIssueRepository ¶
func (irr *IssueRepositoryRow) FromIssueRepository(ir *entity.IssueRepository)
type IssueRepositoryServiceRow ¶
type IssueRepositoryServiceRow struct { IssueRepositoryId sql.NullInt64 `db:"issuerepositoryservice_issue_repository_id" json:"issue_repository_id"` ServiceId sql.NullInt64 `db:"issuerepositoryservice_service_id" json:"service_id"` Priority sql.NullInt64 `db:"issuerepositoryservice_priority" json:"priority"` CreatedAt sql.NullTime `db:"issuerepositoryservice_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"issuerepositoryservice_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuerepositoryservice_updated_at" json:"updated_at"` }
type IssueRow ¶
type IssueRow struct { Id sql.NullInt64 `db:"issue_id" json:"id"` Type sql.NullString `db:"issue_type" json:"type"` PrimaryName sql.NullString `db:"issue_primary_name" json:"primary_name"` Description sql.NullString `db:"issue_description" json:"description"` CreatedAt sql.NullTime `db:"issue_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"issue_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issue_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issue_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"issue_updated_by" json:"updated_by"` }
type IssueVariantRow ¶
type IssueVariantRow struct { Id sql.NullInt64 `db:"issuevariant_id" json:"id"` IssueId sql.NullInt64 `db:"issuevariant_issue_id" json:"issue_id"` IssueRepositoryId sql.NullInt64 `db:"issuevariant_repository_id" json:"issue_repository_id"` SecondaryName sql.NullString `db:"issuevariant_secondary_name" json:"secondary_name"` Vector sql.NullString `db:"issuevariant_vector" json:"vector"` Rating sql.NullString `db:"issuevariant_rating" json:"rating"` RatingNumerical sql.NullInt64 `db:"issuevariant_rating_num" json:"rating_numerical"` Description sql.NullString `db:"issuevariant_description" json:"description"` ExternalUrl sql.NullString `db:"issuevariant_external_url" json:"external_url"` CreatedAt sql.NullTime `db:"issuevariant_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"issuevariant_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"issuevariant_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"issuevariant_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"issuevariant_updated_by" json:"updated_by"` }
func (*IssueVariantRow) AsIssueVariant ¶
func (ivr *IssueVariantRow) AsIssueVariant(repository *entity.IssueRepository) entity.IssueVariant
func (*IssueVariantRow) FromIssueVariant ¶
func (ivr *IssueVariantRow) FromIssueVariant(iv *entity.IssueVariant)
type IssueVariantWithRepository ¶
type IssueVariantWithRepository struct { IssueRepositoryRow IssueVariantRow }
func (*IssueVariantWithRepository) AsIssueVariantEntry ¶
func (ivwr *IssueVariantWithRepository) AsIssueVariantEntry() entity.IssueVariant
type NewCursor ¶
type NewCursor func(cursors *cursors) error
func WithComponent ¶ added in v1.18.0
func WithComponent(order []entity.Order, c entity.Component, cv entity.ComponentVersion, isc entity.IssueSeverityCounts) NewCursor
func WithComponentInstance ¶
func WithComponentInstance(order []entity.Order, ci entity.ComponentInstance) NewCursor
func WithComponentVersion ¶
func WithComponentVersion(order []entity.Order, cv entity.ComponentVersion, isc entity.IssueSeverityCounts) NewCursor
func WithIssueMatch ¶
func WithIssueMatch(order []entity.Order, im entity.IssueMatch) NewCursor
func WithService ¶
func WithSupportGroup ¶ added in v1.13.0
func WithSupportGroup(order []entity.Order, sg entity.SupportGroup) NewCursor
type OwnerRow ¶
type OwnerRow struct { ServiceId sql.NullInt64 `db:"owner_service_id" json:"service_id"` UserId sql.NullInt64 `db:"owner_user_id" json:"user_id"` CreatedAt sql.NullTime `db:"owner_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"owner_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"owner_updated_at" json:"updated_at"` }
type QuietDb ¶ added in v1.17.0
type QuietDb struct {
// contains filtered or unexported fields
}
func (*QuietDb) GetDbInstance ¶ added in v1.17.0
func (*QuietDb) PrepareNamed ¶ added in v1.17.0
type RatingCount ¶
type RatingCount struct { Critical sql.NullInt64 `db:"critical_count"` High sql.NullInt64 `db:"high_count"` Medium sql.NullInt64 `db:"medium_count"` Low sql.NullInt64 `db:"low_count"` None sql.NullInt64 `db:"none_count"` }
func (*RatingCount) AsIssueSeverityCounts ¶
func (rc *RatingCount) AsIssueSeverityCounts() entity.IssueSeverityCounts
type RowComposite ¶
type RowComposite struct { *IssueRow *IssueCountRow *GetIssuesByRow *IssueMatchRow *IssueAggregationsRow *IssueVariantRow *BaseIssueRepositoryRow *IssueRepositoryRow *IssueVariantWithRepository *ComponentRow *ComponentInstanceRow *ComponentVersionRow *BaseServiceRow *ServiceRow *GetServicesByRow *ServiceAggregationsRow *ActivityRow *UserRow *EvidenceRow *OwnerRow *SupportGroupRow *SupportGroupServiceRow *ActivityHasIssueRow *ActivityHasServiceRow *IssueRepositoryServiceRow *IssueMatchChangeRow *ServiceIssueVariantRow *RatingCount }
RowComposite is a composite type that contains all the row types for the database This is used to unmarshal the database rows into the corresponding entity types in a dynamical manner
type ScannerRunRow ¶
type ScannerRunRow struct { RunID sql.NullInt64 `db:"scannerrun_run_id"` UUID sql.NullString `db:"scannerrun_uuid"` Tag sql.NullString `db:"scannerrun_tag"` StartRun sql.NullTime `db:"scannerrun_start_run"` EndRun sql.NullTime `db:"scannerrun_end_run"` IsCompleted sql.NullBool `db:"scannerrun_is_completed"` }
func (*ScannerRunRow) AsScannerRun ¶
func (srr *ScannerRunRow) AsScannerRun() entity.ScannerRun
func (*ScannerRunRow) FromScannerRun ¶
func (srr *ScannerRunRow) FromScannerRun(sr *entity.ScannerRun)
type ServiceAggregationsRow ¶
type ServiceAggregationsRow struct { ComponentInstances sql.NullInt64 `db:"service_agg_component_instances"` IssueMatches sql.NullInt64 `db:"service_agg_issue_matches"` }
func (*ServiceAggregationsRow) AsServiceAggregations ¶
func (sar *ServiceAggregationsRow) AsServiceAggregations() entity.ServiceAggregations
type ServiceIssueVariantRow ¶
type ServiceIssueVariantRow struct { IssueRepositoryRow IssueVariantRow }
func (*ServiceIssueVariantRow) AsServiceIssueVariantEntry ¶
func (siv *ServiceIssueVariantRow) AsServiceIssueVariantEntry() entity.ServiceIssueVariant
type ServiceRow ¶
type ServiceRow struct { BaseServiceRow IssueRepositoryServiceRow }
func (*ServiceRow) AsService ¶
func (sr *ServiceRow) AsService() entity.Service
func (*ServiceRow) FromService ¶
func (sr *ServiceRow) FromService(s *entity.Service)
type SqlDatabase ¶
type SqlDatabase struct {
// contains filtered or unexported fields
}
func NewSqlDatabase ¶
func NewSqlDatabase(cfg util.Config) (*SqlDatabase, error)
func (*SqlDatabase) AddComponentVersionToIssue ¶
func (s *SqlDatabase) AddComponentVersionToIssue(issueId int64, componentVersionId int64) error
func (*SqlDatabase) AddEvidenceToIssueMatch ¶
func (s *SqlDatabase) AddEvidenceToIssueMatch(issueMatchId int64, evidenceId int64) error
func (*SqlDatabase) AddIssueRepositoryToService ¶
func (s *SqlDatabase) AddIssueRepositoryToService(serviceId int64, issueRepositoryId int64, priority int64) error
func (*SqlDatabase) AddIssueToActivity ¶
func (s *SqlDatabase) AddIssueToActivity(activityId int64, issueId int64) error
func (*SqlDatabase) AddOwnerToService ¶
func (s *SqlDatabase) AddOwnerToService(serviceId int64, userId int64) error
func (*SqlDatabase) AddServiceToActivity ¶
func (s *SqlDatabase) AddServiceToActivity(activityId int64, serviceId int64) error
func (*SqlDatabase) AddServiceToSupportGroup ¶
func (s *SqlDatabase) AddServiceToSupportGroup(supportGroupId int64, serviceId int64) error
func (*SqlDatabase) AddUserToSupportGroup ¶
func (s *SqlDatabase) AddUserToSupportGroup(supportGroupId int64, userId int64) error
func (*SqlDatabase) Autoclose ¶
func (s *SqlDatabase) Autoclose() (bool, error)
func (*SqlDatabase) CloseConnection ¶
func (s *SqlDatabase) CloseConnection() error
func (*SqlDatabase) CompleteScannerRun ¶
func (s *SqlDatabase) CompleteScannerRun(uuid string) (bool, error)
func (*SqlDatabase) ConnectDB ¶
func (s *SqlDatabase) ConnectDB(dbName string) error
func (*SqlDatabase) CountActivities ¶
func (s *SqlDatabase) CountActivities(filter *entity.ActivityFilter) (int64, error)
func (*SqlDatabase) CountComponentInstances ¶
func (s *SqlDatabase) CountComponentInstances(filter *entity.ComponentInstanceFilter) (int64, error)
func (*SqlDatabase) CountComponentVersions ¶
func (s *SqlDatabase) CountComponentVersions(filter *entity.ComponentVersionFilter) (int64, error)
func (*SqlDatabase) CountComponentVulnerabilities ¶ added in v1.18.0
func (s *SqlDatabase) CountComponentVulnerabilities(filter *entity.ComponentFilter) ([]entity.IssueSeverityCounts, error)
func (*SqlDatabase) CountComponents ¶
func (s *SqlDatabase) CountComponents(filter *entity.ComponentFilter) (int64, error)
func (*SqlDatabase) CountEvidences ¶
func (s *SqlDatabase) CountEvidences(filter *entity.EvidenceFilter) (int64, error)
func (*SqlDatabase) CountIssueMatchChanges ¶
func (s *SqlDatabase) CountIssueMatchChanges(filter *entity.IssueMatchChangeFilter) (int64, error)
func (*SqlDatabase) CountIssueMatches ¶
func (s *SqlDatabase) CountIssueMatches(filter *entity.IssueMatchFilter) (int64, error)
func (*SqlDatabase) CountIssueRatings ¶
func (s *SqlDatabase) CountIssueRatings(filter *entity.IssueFilter) (*entity.IssueSeverityCounts, error)
func (*SqlDatabase) CountIssueRepositories ¶
func (s *SqlDatabase) CountIssueRepositories(filter *entity.IssueRepositoryFilter) (int64, error)
func (*SqlDatabase) CountIssueTypes ¶
func (s *SqlDatabase) CountIssueTypes(filter *entity.IssueFilter) (*entity.IssueTypeCounts, error)
func (*SqlDatabase) CountIssueVariants ¶
func (s *SqlDatabase) CountIssueVariants(filter *entity.IssueVariantFilter) (int64, error)
func (*SqlDatabase) CountIssues ¶
func (s *SqlDatabase) CountIssues(filter *entity.IssueFilter) (int64, error)
func (*SqlDatabase) CountScannerRuns ¶
func (s *SqlDatabase) CountScannerRuns(filter *entity.ScannerRunFilter) (int, error)
func (*SqlDatabase) CountServices ¶
func (s *SqlDatabase) CountServices(filter *entity.ServiceFilter) (int64, error)
func (*SqlDatabase) CountSupportGroups ¶
func (s *SqlDatabase) CountSupportGroups(filter *entity.SupportGroupFilter) (int64, error)
func (*SqlDatabase) CountUsers ¶
func (s *SqlDatabase) CountUsers(filter *entity.UserFilter) (int64, error)
func (*SqlDatabase) CreateActivity ¶
func (*SqlDatabase) CreateComponent ¶
func (*SqlDatabase) CreateComponentInstance ¶
func (s *SqlDatabase) CreateComponentInstance(componentInstance *entity.ComponentInstance) (*entity.ComponentInstance, error)
func (*SqlDatabase) CreateComponentVersion ¶
func (s *SqlDatabase) CreateComponentVersion(componentVersion *entity.ComponentVersion) (*entity.ComponentVersion, error)
func (*SqlDatabase) CreateEvidence ¶
func (*SqlDatabase) CreateIssue ¶
func (*SqlDatabase) CreateIssueMatch ¶
func (s *SqlDatabase) CreateIssueMatch(issueMatch *entity.IssueMatch) (*entity.IssueMatch, error)
func (*SqlDatabase) CreateIssueMatchChange ¶
func (s *SqlDatabase) CreateIssueMatchChange(imc *entity.IssueMatchChange) (*entity.IssueMatchChange, error)
func (*SqlDatabase) CreateIssueRepository ¶
func (s *SqlDatabase) CreateIssueRepository(issueRepository *entity.IssueRepository) (*entity.IssueRepository, error)
func (*SqlDatabase) CreateIssueVariant ¶
func (s *SqlDatabase) CreateIssueVariant(issueVariant *entity.IssueVariant) (*entity.IssueVariant, error)
func (*SqlDatabase) CreateScannerRun ¶
func (s *SqlDatabase) CreateScannerRun(scannerRun *entity.ScannerRun) (bool, error)
func (*SqlDatabase) CreateScannerRunComponentInstanceTracker ¶
func (s *SqlDatabase) CreateScannerRunComponentInstanceTracker(componentInstanceId int64, scannerRunUUID string) error
func (*SqlDatabase) CreateService ¶
func (*SqlDatabase) CreateSupportGroup ¶
func (s *SqlDatabase) CreateSupportGroup(supportGroup *entity.SupportGroup) (*entity.SupportGroup, error)
func (*SqlDatabase) CreateUser ¶
func (*SqlDatabase) DeleteActivity ¶
func (s *SqlDatabase) DeleteActivity(id int64, userId int64) error
func (*SqlDatabase) DeleteComponent ¶
func (s *SqlDatabase) DeleteComponent(id int64, userId int64) error
func (*SqlDatabase) DeleteComponentInstance ¶
func (s *SqlDatabase) DeleteComponentInstance(id int64, userId int64) error
func (*SqlDatabase) DeleteComponentVersion ¶
func (s *SqlDatabase) DeleteComponentVersion(id int64, userId int64) error
func (*SqlDatabase) DeleteEvidence ¶
func (s *SqlDatabase) DeleteEvidence(id int64, userId int64) error
func (*SqlDatabase) DeleteIssue ¶
func (s *SqlDatabase) DeleteIssue(id int64, userId int64) error
func (*SqlDatabase) DeleteIssueMatch ¶
func (s *SqlDatabase) DeleteIssueMatch(id int64, userId int64) error
func (*SqlDatabase) DeleteIssueMatchChange ¶
func (s *SqlDatabase) DeleteIssueMatchChange(id int64, userId int64) error
func (*SqlDatabase) DeleteIssueRepository ¶
func (s *SqlDatabase) DeleteIssueRepository(id int64, userId int64) error
func (*SqlDatabase) DeleteIssueVariant ¶
func (s *SqlDatabase) DeleteIssueVariant(id int64, userId int64) error
func (*SqlDatabase) DeleteService ¶
func (s *SqlDatabase) DeleteService(id int64, userId int64) error
func (*SqlDatabase) DeleteSupportGroup ¶
func (s *SqlDatabase) DeleteSupportGroup(id int64, userId int64) error
func (*SqlDatabase) DeleteUser ¶
func (s *SqlDatabase) DeleteUser(id int64, userId int64) error
func (*SqlDatabase) DropSchema ¶
func (s *SqlDatabase) DropSchema(name string) error
func (*SqlDatabase) FailScannerRun ¶
func (s *SqlDatabase) FailScannerRun(uuid string, message string) (bool, error)
func (*SqlDatabase) GetActivities ¶
func (s *SqlDatabase) GetActivities(filter *entity.ActivityFilter) ([]entity.Activity, error)
func (*SqlDatabase) GetAllActivityIds ¶
func (s *SqlDatabase) GetAllActivityIds(filter *entity.ActivityFilter) ([]int64, error)
func (*SqlDatabase) GetAllComponentCursors ¶ added in v1.18.0
func (s *SqlDatabase) GetAllComponentCursors(filter *entity.ComponentFilter, order []entity.Order) ([]string, error)
func (*SqlDatabase) GetAllComponentIds ¶
func (s *SqlDatabase) GetAllComponentIds(filter *entity.ComponentFilter) ([]int64, error)
func (*SqlDatabase) GetAllComponentInstanceCursors ¶
func (s *SqlDatabase) GetAllComponentInstanceCursors(filter *entity.ComponentInstanceFilter, order []entity.Order) ([]string, error)
func (*SqlDatabase) GetAllComponentInstanceIds ¶
func (s *SqlDatabase) GetAllComponentInstanceIds(filter *entity.ComponentInstanceFilter) ([]int64, error)
func (*SqlDatabase) GetAllComponentVersionCursors ¶
func (s *SqlDatabase) GetAllComponentVersionCursors(filter *entity.ComponentVersionFilter, order []entity.Order) ([]string, error)
func (*SqlDatabase) GetAllComponentVersionIds ¶
func (s *SqlDatabase) GetAllComponentVersionIds(filter *entity.ComponentVersionFilter) ([]int64, error)
func (*SqlDatabase) GetAllEvidenceIds ¶
func (s *SqlDatabase) GetAllEvidenceIds(filter *entity.EvidenceFilter) ([]int64, error)
func (*SqlDatabase) GetAllIssueCursors ¶
func (s *SqlDatabase) GetAllIssueCursors(filter *entity.IssueFilter, order []entity.Order) ([]string, error)
func (*SqlDatabase) GetAllIssueIds ¶
func (s *SqlDatabase) GetAllIssueIds(filter *entity.IssueFilter) ([]int64, error)
func (*SqlDatabase) GetAllIssueMatchChangeIds ¶
func (s *SqlDatabase) GetAllIssueMatchChangeIds(filter *entity.IssueMatchChangeFilter) ([]int64, error)
func (*SqlDatabase) GetAllIssueMatchCursors ¶
func (s *SqlDatabase) GetAllIssueMatchCursors(filter *entity.IssueMatchFilter, order []entity.Order) ([]string, error)
func (*SqlDatabase) GetAllIssueMatchIds ¶
func (s *SqlDatabase) GetAllIssueMatchIds(filter *entity.IssueMatchFilter) ([]int64, error)
func (*SqlDatabase) GetAllIssueRepositoryIds ¶
func (s *SqlDatabase) GetAllIssueRepositoryIds(filter *entity.IssueRepositoryFilter) ([]int64, error)
func (*SqlDatabase) GetAllIssueVariantIds ¶
func (s *SqlDatabase) GetAllIssueVariantIds(filter *entity.IssueVariantFilter) ([]int64, error)
func (*SqlDatabase) GetAllServiceCursors ¶
func (s *SqlDatabase) GetAllServiceCursors(filter *entity.ServiceFilter, order []entity.Order) ([]string, error)
func (*SqlDatabase) GetAllServiceIds ¶
func (s *SqlDatabase) GetAllServiceIds(filter *entity.ServiceFilter) ([]int64, error)
func (*SqlDatabase) GetAllSupportGroupCursors ¶ added in v1.13.0
func (s *SqlDatabase) GetAllSupportGroupCursors(filter *entity.SupportGroupFilter, order []entity.Order) ([]string, error)
func (*SqlDatabase) GetAllSupportGroupIds ¶
func (s *SqlDatabase) GetAllSupportGroupIds(filter *entity.SupportGroupFilter) ([]int64, error)
func (*SqlDatabase) GetAllUserIds ¶
func (s *SqlDatabase) GetAllUserIds(filter *entity.UserFilter) ([]int64, error)
func (*SqlDatabase) GetCcrn ¶
func (s *SqlDatabase) GetCcrn(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetCluster ¶
func (s *SqlDatabase) GetCluster(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetComponentCcrns ¶
func (s *SqlDatabase) GetComponentCcrns(filter *entity.ComponentFilter) ([]string, error)
func (*SqlDatabase) GetComponentInstanceParent ¶ added in v1.1.0
func (s *SqlDatabase) GetComponentInstanceParent(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetComponentInstances ¶
func (s *SqlDatabase) GetComponentInstances(filter *entity.ComponentInstanceFilter, order []entity.Order) ([]entity.ComponentInstanceResult, error)
func (*SqlDatabase) GetComponentVersions ¶
func (s *SqlDatabase) GetComponentVersions(filter *entity.ComponentVersionFilter, order []entity.Order) ([]entity.ComponentVersionResult, error)
func (*SqlDatabase) GetComponents ¶
func (s *SqlDatabase) GetComponents(filter *entity.ComponentFilter, order []entity.Order) ([]entity.ComponentResult, error)
func (*SqlDatabase) GetContainer ¶
func (s *SqlDatabase) GetContainer(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetContext ¶
func (s *SqlDatabase) GetContext(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetDefaultIssuePriority ¶
func (s *SqlDatabase) GetDefaultIssuePriority() int64
GetDefaultIssuePriority ...
func (*SqlDatabase) GetDefaultRepositoryName ¶
func (s *SqlDatabase) GetDefaultRepositoryName() string
func (*SqlDatabase) GetDomain ¶
func (s *SqlDatabase) GetDomain(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetEvidences ¶
func (s *SqlDatabase) GetEvidences(filter *entity.EvidenceFilter) ([]entity.Evidence, error)
func (*SqlDatabase) GetIssueMatchChanges ¶
func (s *SqlDatabase) GetIssueMatchChanges(filter *entity.IssueMatchChangeFilter) ([]entity.IssueMatchChange, error)
func (*SqlDatabase) GetIssueMatches ¶
func (s *SqlDatabase) GetIssueMatches(filter *entity.IssueMatchFilter, order []entity.Order) ([]entity.IssueMatchResult, error)
func (*SqlDatabase) GetIssueNames ¶
func (s *SqlDatabase) GetIssueNames(filter *entity.IssueFilter) ([]string, error)
func (*SqlDatabase) GetIssueRepositories ¶
func (s *SqlDatabase) GetIssueRepositories(filter *entity.IssueRepositoryFilter) ([]entity.IssueRepository, error)
func (*SqlDatabase) GetIssueVariants ¶
func (s *SqlDatabase) GetIssueVariants(filter *entity.IssueVariantFilter) ([]entity.IssueVariant, error)
func (*SqlDatabase) GetIssues ¶
func (s *SqlDatabase) GetIssues(filter *entity.IssueFilter, order []entity.Order) ([]entity.IssueResult, error)
func (*SqlDatabase) GetIssuesWithAggregations ¶
func (s *SqlDatabase) GetIssuesWithAggregations(filter *entity.IssueFilter, order []entity.Order) ([]entity.IssueResult, error)
func (*SqlDatabase) GetNamespace ¶
func (s *SqlDatabase) GetNamespace(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetPod ¶
func (s *SqlDatabase) GetPod(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetProject ¶
func (s *SqlDatabase) GetProject(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetRegion ¶
func (s *SqlDatabase) GetRegion(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetScannerRunTags ¶
func (s *SqlDatabase) GetScannerRunTags() ([]string, error)
func (*SqlDatabase) GetScannerRuns ¶
func (s *SqlDatabase) GetScannerRuns(filter *entity.ScannerRunFilter) ([]entity.ScannerRun, error)
func (*SqlDatabase) GetServiceCcrns ¶
func (s *SqlDatabase) GetServiceCcrns(filter *entity.ServiceFilter) ([]string, error)
func (*SqlDatabase) GetServiceDomains ¶ added in v1.23.0
func (s *SqlDatabase) GetServiceDomains(filter *entity.ServiceFilter) ([]string, error)
func (*SqlDatabase) GetServiceIssueVariants ¶
func (s *SqlDatabase) GetServiceIssueVariants(filter *entity.ServiceIssueVariantFilter) ([]entity.ServiceIssueVariant, error)
func (*SqlDatabase) GetServiceRegions ¶ added in v1.23.0
func (s *SqlDatabase) GetServiceRegions(filter *entity.ServiceFilter) ([]string, error)
func (*SqlDatabase) GetServices ¶
func (s *SqlDatabase) GetServices(filter *entity.ServiceFilter, order []entity.Order) ([]entity.ServiceResult, error)
func (*SqlDatabase) GetServicesWithAggregations ¶
func (s *SqlDatabase) GetServicesWithAggregations(filter *entity.ServiceFilter, order []entity.Order) ([]entity.ServiceResult, error)
func (*SqlDatabase) GetSupportGroupCcrns ¶
func (s *SqlDatabase) GetSupportGroupCcrns(filter *entity.SupportGroupFilter) ([]string, error)
func (*SqlDatabase) GetSupportGroups ¶
func (s *SqlDatabase) GetSupportGroups(filter *entity.SupportGroupFilter, order []entity.Order) ([]entity.SupportGroupResult, error)
func (*SqlDatabase) GetType ¶
func (s *SqlDatabase) GetType(filter *entity.ComponentInstanceFilter) ([]string, error)
func (*SqlDatabase) GetUniqueUserIDs ¶
func (s *SqlDatabase) GetUniqueUserIDs(filter *entity.UserFilter) ([]string, error)
func (*SqlDatabase) GetUserNames ¶
func (s *SqlDatabase) GetUserNames(filter *entity.UserFilter) ([]string, error)
func (*SqlDatabase) GetUsers ¶
func (s *SqlDatabase) GetUsers(filter *entity.UserFilter) ([]entity.User, error)
func (*SqlDatabase) GetVersion ¶
func (s *SqlDatabase) GetVersion() (string, error)
func (*SqlDatabase) GrantAccess ¶
func (s *SqlDatabase) GrantAccess(username string, database string, host string) error
func (*SqlDatabase) RemoveComponentVersionFromIssue ¶
func (s *SqlDatabase) RemoveComponentVersionFromIssue(issueId int64, componentVersionId int64) error
func (*SqlDatabase) RemoveEvidenceFromIssueMatch ¶
func (s *SqlDatabase) RemoveEvidenceFromIssueMatch(issueMatchId int64, evidenceId int64) error
func (*SqlDatabase) RemoveIssueFromActivity ¶
func (s *SqlDatabase) RemoveIssueFromActivity(activityId int64, issueId int64) error
func (*SqlDatabase) RemoveIssueRepositoryFromService ¶
func (s *SqlDatabase) RemoveIssueRepositoryFromService(serviceId int64, issueRepositoryId int64) error
func (*SqlDatabase) RemoveOwnerFromService ¶
func (s *SqlDatabase) RemoveOwnerFromService(serviceId int64, userId int64) error
func (*SqlDatabase) RemoveServiceFromActivity ¶
func (s *SqlDatabase) RemoveServiceFromActivity(activityId int64, serviceId int64) error
func (*SqlDatabase) RemoveServiceFromSupportGroup ¶
func (s *SqlDatabase) RemoveServiceFromSupportGroup(supportGroupId int64, serviceId int64) error
func (*SqlDatabase) RemoveUserFromSupportGroup ¶
func (s *SqlDatabase) RemoveUserFromSupportGroup(supportGroupId int64, userId int64) error
func (*SqlDatabase) RunPostMigrations ¶ added in v1.19.0
func (s *SqlDatabase) RunPostMigrations() error
func (*SqlDatabase) RunUpMigrations ¶ added in v1.19.0
func (s *SqlDatabase) RunUpMigrations() error
func (*SqlDatabase) ScannerRunByUUID ¶
func (s *SqlDatabase) ScannerRunByUUID(uuid string) (*entity.ScannerRun, error)
func (*SqlDatabase) UpdateActivity ¶
func (s *SqlDatabase) UpdateActivity(activity *entity.Activity) error
func (*SqlDatabase) UpdateComponent ¶
func (s *SqlDatabase) UpdateComponent(component *entity.Component) error
func (*SqlDatabase) UpdateComponentInstance ¶
func (s *SqlDatabase) UpdateComponentInstance(componentInstance *entity.ComponentInstance) error
func (*SqlDatabase) UpdateComponentVersion ¶
func (s *SqlDatabase) UpdateComponentVersion(componentVersion *entity.ComponentVersion) error
func (*SqlDatabase) UpdateEvidence ¶
func (s *SqlDatabase) UpdateEvidence(evidence *entity.Evidence) error
func (*SqlDatabase) UpdateIssue ¶
func (s *SqlDatabase) UpdateIssue(issue *entity.Issue) error
func (*SqlDatabase) UpdateIssueMatch ¶
func (s *SqlDatabase) UpdateIssueMatch(issueMatch *entity.IssueMatch) error
func (*SqlDatabase) UpdateIssueMatchChange ¶
func (s *SqlDatabase) UpdateIssueMatchChange(imc *entity.IssueMatchChange) error
func (*SqlDatabase) UpdateIssueRepository ¶
func (s *SqlDatabase) UpdateIssueRepository(issueRepository *entity.IssueRepository) error
func (*SqlDatabase) UpdateIssueVariant ¶
func (s *SqlDatabase) UpdateIssueVariant(issueVariant *entity.IssueVariant) error
func (*SqlDatabase) UpdateService ¶
func (s *SqlDatabase) UpdateService(service *entity.Service) error
func (*SqlDatabase) UpdateSupportGroup ¶
func (s *SqlDatabase) UpdateSupportGroup(supportGroup *entity.SupportGroup) error
func (*SqlDatabase) UpdateUser ¶
func (s *SqlDatabase) UpdateUser(user *entity.User) error
func (*SqlDatabase) WaitPostMigrations ¶ added in v1.22.0
func (s *SqlDatabase) WaitPostMigrations() error
type SupportGroupRow ¶
type SupportGroupRow struct { Id sql.NullInt64 `db:"supportgroup_id" json:"id"` CCRN sql.NullString `db:"supportgroup_ccrn" json:"ccrn"` CreatedAt sql.NullTime `db:"supportgroup_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"supportgroup_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"supportgroup_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"supportgroup_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"supportgroup_updated_by" json:"updated_by"` }
func (*SupportGroupRow) AsSupportGroup ¶
func (sgr *SupportGroupRow) AsSupportGroup() entity.SupportGroup
func (*SupportGroupRow) FromSupportGroup ¶
func (sgr *SupportGroupRow) FromSupportGroup(sg *entity.SupportGroup)
type SupportGroupServiceRow ¶
type SupportGroupServiceRow struct { SupportGroupId sql.NullInt64 `db:"supportgroupservice_support_group_id" json:"support_group_id"` ServiceId sql.NullInt64 `db:"supportgroupservice_service_id" json:"service_id"` CreatedAt sql.NullTime `db:"supportgroupservice_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"supportgroupservice_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"supportgroupservice_updated_at" json:"updated_at"` }
type SupportGroupUserRow ¶
type SupportGroupUserRow struct { SupportGroupId sql.NullInt64 `db:"supportgroupuser_support_group_id" json:"support_group_id"` UserId sql.NullInt64 `db:"supportgroupuser_user_id" json:"user_id"` CreatedAt sql.NullTime `db:"supportgroupuser_created_at" json:"created_at"` DeletedAt sql.NullTime `db:"supportgroupuser_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"supportgroupuser_updated_at" json:"updated_at"` }
type TraceDb ¶ added in v1.17.0
type TraceDb struct {
// contains filtered or unexported fields
}
TraceDb
func (*TraceDb) GetDbInstance ¶ added in v1.17.0
func (*TraceDb) PrepareNamed ¶ added in v1.17.0
type TraceNamedStmt ¶ added in v1.17.3
type TraceNamedStmt struct {
// contains filtered or unexported fields
}
TraceNamedStmt
func (*TraceNamedStmt) Close ¶ added in v1.17.3
func (tns *TraceNamedStmt) Close() error
type TraceSqlRows ¶ added in v1.17.3
type TraceSqlRows struct {
// contains filtered or unexported fields
}
TraceSqlRows
func (*TraceSqlRows) Close ¶ added in v1.17.3
func (tsr *TraceSqlRows) Close() error
func (*TraceSqlRows) Err ¶ added in v1.17.3
func (tsr *TraceSqlRows) Err() error
func (*TraceSqlRows) Next ¶ added in v1.17.3
func (tsr *TraceSqlRows) Next() bool
func (*TraceSqlRows) Scan ¶ added in v1.17.3
func (tsr *TraceSqlRows) Scan(dest ...any) error
type TraceStmt ¶ added in v1.17.3
type TraceStmt struct {
// contains filtered or unexported fields
}
TraceStmt
type UserRow ¶
type UserRow struct { Id sql.NullInt64 `db:"user_id" json:"id"` Name sql.NullString `db:"user_name" json:"ccrn"` UniqueUserID sql.NullString `db:"user_unique_user_id" json:"unique_user_id"` Type sql.NullInt64 `db:"user_type" json:"type"` CreatedAt sql.NullTime `db:"user_created_at" json:"created_at"` CreatedBy sql.NullInt64 `db:"user_created_by" json:"created_by"` DeletedAt sql.NullTime `db:"user_deleted_at" json:"deleted_at,omitempty"` UpdatedAt sql.NullTime `db:"user_updated_at" json:"updated_at"` UpdatedBy sql.NullInt64 `db:"user_updated_by" json:"Updated_by"` Email sql.NullString `db:"user_email" json:"email"` }
Source Files
¶
- activity.go
- autoclose.go
- component.go
- component_instance.go
- component_version.go
- cursor.go
- database.go
- entity.go
- evidence.go
- issue.go
- issue_match.go
- issue_match_change.go
- issue_repository.go
- issue_variant.go
- migration.go
- order.go
- quiet_db.go
- scanner_run.go
- service.go
- service_issue_variant.go
- support_group.go
- trace_db.go
- user.go
Click to show internal directories.
Click to hide internal directories.