Documentation
¶
Index ¶
- Constants
- Variables
- func BuildIssueVariantMap(db database.Database, componentInstanceID int64, componentVersionID int64) (map[int64]entity.ServiceIssueVariant, error)
- func OnComponentInstanceCreate(db database.Database, event event.Event)
- func OnComponentVersionAssignmentToComponentInstance(db database.Database, componentInstanceID int64, componentVersionID int64)
- type AddEvidenceToIssueMatchEvent
- type CreateIssueMatchEvent
- type DeleteIssueMatchEvent
- type GetIssueMatchEvent
- type IssueMatchHandler
- type IssueMatchHandlerError
- type ListIssueMatchesEvent
- type RemoveEvidenceFromIssueMatchEvent
- type UpdateIssueMatchEvent
Constants ¶
const ( ListIssueMatchesEventName event.EventName = "ListIssueMatches" GetIssueMatchEventName event.EventName = "GetIssueMatch" CreateIssueMatchEventName event.EventName = "CreateIssueMatch" UpdateIssueMatchEventName event.EventName = "UpdateIssueMatch" DeleteIssueMatchEventName event.EventName = "DeleteIssueMatch" AddEvidenceToIssueMatchEventName event.EventName = "AddEvidenceToIssueMatch" RemoveEvidenceFromIssueMatchEventName event.EventName = "RemoveEvidenceFromIssueMatch" ListIssueMatchIDsEventName event.EventName = "ListIssueMatchIDs" )
Variables ¶
Functions ¶
func BuildIssueVariantMap ¶
func BuildIssueVariantMap(db database.Database, componentInstanceID int64, componentVersionID int64) (map[int64]entity.ServiceIssueVariant, error)
BuildIssueVariantMap builds a map of issue id to issue variant for the given issues and component instance id it does take the first issue_variant with the highest priority for the respective component instance. This is archived by utilizing database.GetServiceIssueVariants that does return ALL issue variants for a given component instance id together with the priorty and afterwards identifying for each issue the variant with the highest priority
Returns a map of issue id to issue variant
func OnComponentVersionAssignmentToComponentInstance ¶
func OnComponentVersionAssignmentToComponentInstance(db database.Database, componentInstanceID int64, componentVersionID int64)
OnComponentVersionAssignmentToComponentInstance is an event handler that is triggered when a component version is assigned to a component instance. It creates for the component instance ID that is assigned to component version ID a new issue match for each issue that is related to the component version. to do so it utilizes BuildIssueVariantMap to get the issue variants for the issues to identify the severity of the issueMatch.
Types ¶
type AddEvidenceToIssueMatchEvent ¶
func (*AddEvidenceToIssueMatchEvent) Name ¶
func (e *AddEvidenceToIssueMatchEvent) Name() event.EventName
type CreateIssueMatchEvent ¶
type CreateIssueMatchEvent struct {
IssueMatch *entity.IssueMatch
}
func (*CreateIssueMatchEvent) Name ¶
func (e *CreateIssueMatchEvent) Name() event.EventName
type DeleteIssueMatchEvent ¶
type DeleteIssueMatchEvent struct {
IssueMatchID int64
}
func (*DeleteIssueMatchEvent) Name ¶
func (e *DeleteIssueMatchEvent) Name() event.EventName
type GetIssueMatchEvent ¶
type GetIssueMatchEvent struct {
IssueMatchID int64
Result *entity.IssueMatch
}
func (*GetIssueMatchEvent) Name ¶
func (e *GetIssueMatchEvent) Name() event.EventName
type IssueMatchHandler ¶
type IssueMatchHandler interface {
ListIssueMatches(filter *entity.IssueMatchFilter, options *entity.ListOptions) (*entity.List[entity.IssueMatchResult], error)
GetIssueMatch(int64) (*entity.IssueMatch, error)
CreateIssueMatch(context.Context, *entity.IssueMatch) (*entity.IssueMatch, error)
UpdateIssueMatch(context.Context, *entity.IssueMatch) (*entity.IssueMatch, error)
DeleteIssueMatch(context.Context, int64) error
AddEvidenceToIssueMatch(int64, int64) (*entity.IssueMatch, error)
RemoveEvidenceFromIssueMatch(int64, int64) (*entity.IssueMatch, error)
}
func NewIssueMatchHandler ¶
func NewIssueMatchHandler(handlerContext common.HandlerContext, ss severity.SeverityHandler) IssueMatchHandler
type IssueMatchHandlerError ¶
type IssueMatchHandlerError struct {
// contains filtered or unexported fields
}
func NewIssueMatchHandlerError ¶
func NewIssueMatchHandlerError(message string) *IssueMatchHandlerError
func (*IssueMatchHandlerError) Error ¶
func (e *IssueMatchHandlerError) Error() string
type ListIssueMatchesEvent ¶
type ListIssueMatchesEvent struct {
Filter *entity.IssueMatchFilter
Options *entity.ListOptions
Results *entity.List[entity.IssueMatchResult]
}
func (*ListIssueMatchesEvent) Name ¶
func (e *ListIssueMatchesEvent) Name() event.EventName
type RemoveEvidenceFromIssueMatchEvent ¶
func (*RemoveEvidenceFromIssueMatchEvent) Name ¶
func (e *RemoveEvidenceFromIssueMatchEvent) Name() event.EventName
type UpdateIssueMatchEvent ¶
type UpdateIssueMatchEvent struct {
IssueMatch *entity.IssueMatch
}
func (*UpdateIssueMatchEvent) Name ¶
func (e *UpdateIssueMatchEvent) Name() event.EventName