mocks

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAlertRepository

type MockAlertRepository struct {
	mock.Mock
}

* Mock Repository

func (*MockAlertRepository) DeactivateAlert

func (m *MockAlertRepository) DeactivateAlert(context.Context, *model.Alert) error

func (*MockAlertRepository) DeleteAlert

func (*MockAlertRepository) DeleteAlertCondNotification

func (m *MockAlertRepository) DeleteAlertCondNotification(context.Context, uint32, uint32, uint32) error

func (*MockAlertRepository) DeleteAlertCondRule

func (m *MockAlertRepository) DeleteAlertCondRule(context.Context, uint32, uint32, uint32) error

func (*MockAlertRepository) DeleteAlertCondition

func (m *MockAlertRepository) DeleteAlertCondition(context.Context, uint32, uint32) error

func (*MockAlertRepository) DeleteAlertHistory

func (m *MockAlertRepository) DeleteAlertHistory(context.Context, uint32, uint32) error

func (*MockAlertRepository) DeleteAlertRule

func (m *MockAlertRepository) DeleteAlertRule(context.Context, uint32, uint32) error

func (*MockAlertRepository) DeleteNotification

func (m *MockAlertRepository) DeleteNotification(context.Context, uint32, uint32) error

func (*MockAlertRepository) DeleteRelAlertFinding

func (m *MockAlertRepository) DeleteRelAlertFinding(context.Context, uint32, uint32, uint32) error

func (*MockAlertRepository) GetAlert

func (*MockAlertRepository) GetAlertByAlertConditionID

func (m *MockAlertRepository) GetAlertByAlertConditionID(context.Context, uint32, uint32) (*model.Alert, error)

func (*MockAlertRepository) GetAlertByAlertConditionIDStatus

func (m *MockAlertRepository) GetAlertByAlertConditionIDStatus(context.Context, uint32, uint32, []string) (*model.Alert, error)

func (*MockAlertRepository) GetAlertCondNotification

func (*MockAlertRepository) GetAlertCondRule

func (*MockAlertRepository) GetAlertCondition

func (*MockAlertRepository) GetAlertHistory

func (*MockAlertRepository) GetAlertRule

func (*MockAlertRepository) GetNotification

func (*MockAlertRepository) GetRelAlertFinding

func (*MockAlertRepository) ListAlert

func (*MockAlertRepository) ListAlertCondNotification

func (*MockAlertRepository) ListAlertCondRule

func (*MockAlertRepository) ListAlertCondition

func (*MockAlertRepository) ListAlertHistory

func (*MockAlertRepository) ListAlertRule

func (*MockAlertRepository) ListAlertRuleByAlertConditionID

func (m *MockAlertRepository) ListAlertRuleByAlertConditionID(context.Context, uint32, uint32) (*[]model.AlertRule, error)

func (*MockAlertRepository) ListDisabledAlertCondition

func (m *MockAlertRepository) ListDisabledAlertCondition(context.Context, uint32, []uint32) (*[]model.AlertCondition, error)

func (*MockAlertRepository) ListEnabledAlertCondition

func (m *MockAlertRepository) ListEnabledAlertCondition(context.Context, uint32, []uint32) (*[]model.AlertCondition, error)

func (*MockAlertRepository) ListNotification

func (*MockAlertRepository) ListNotificationByAlertConditionID

func (m *MockAlertRepository) ListNotificationByAlertConditionID(context.Context, uint32, uint32) (*[]model.Notification, error)

func (*MockAlertRepository) ListRelAlertFinding

func (*MockAlertRepository) UpsertAlert

func (*MockAlertRepository) UpsertAlertCondNotification

func (*MockAlertRepository) UpsertAlertCondRule

func (*MockAlertRepository) UpsertAlertCondition

func (*MockAlertRepository) UpsertAlertHistory

func (*MockAlertRepository) UpsertAlertRule

func (*MockAlertRepository) UpsertNotification

func (*MockAlertRepository) UpsertRelAlertFinding

type MockFindingRepository

type MockFindingRepository struct {
	mock.Mock
}

* Mock Repository

func (*MockFindingRepository) BatchListFinding

func (*MockFindingRepository) BulkUpsertFinding

func (m *MockFindingRepository) BulkUpsertFinding(ctx context.Context, data []*model.Finding) error

func (*MockFindingRepository) BulkUpsertFindingTag

func (m *MockFindingRepository) BulkUpsertFindingTag(ctx context.Context, data []*model.FindingTag) error

func (*MockFindingRepository) BulkUpsertRecommend

func (m *MockFindingRepository) BulkUpsertRecommend(ctx context.Context, data []*model.Recommend) error

func (*MockFindingRepository) BulkUpsertRecommendFinding

func (m *MockFindingRepository) BulkUpsertRecommendFinding(ctx context.Context, data []*model.RecommendFinding) error

func (*MockFindingRepository) BulkUpsertResource

func (m *MockFindingRepository) BulkUpsertResource(ctx context.Context, data []*model.Resource) error

func (*MockFindingRepository) BulkUpsertResourceTag

func (m *MockFindingRepository) BulkUpsertResourceTag(ctx context.Context, data []*model.ResourceTag) error

func (*MockFindingRepository) ClearScoreFinding

func (m *MockFindingRepository) ClearScoreFinding(ctx context.Context, req *finding.ClearScoreRequest) error

func (*MockFindingRepository) DeleteFinding

func (*MockFindingRepository) DeleteFindingSetting

func (m *MockFindingRepository) DeleteFindingSetting(ctx context.Context, projectID uint32, findingSettingID uint32) error

func (*MockFindingRepository) DeletePendFinding

func (m *MockFindingRepository) DeletePendFinding(context.Context, uint32, uint64) error

func (*MockFindingRepository) DeleteResource

func (m *MockFindingRepository) DeleteResource(context.Context, uint32, uint64) error

func (*MockFindingRepository) GetFinding

func (*MockFindingRepository) GetFindingByDataSource

func (m *MockFindingRepository) GetFindingByDataSource(context.Context, uint32, string, string) (*model.Finding, error)

func (*MockFindingRepository) GetFindingSetting

func (m *MockFindingRepository) GetFindingSetting(ctx context.Context, projectID uint32, findingSettingID uint32) (*model.FindingSetting, error)

func (*MockFindingRepository) GetFindingSettingByResource

func (m *MockFindingRepository) GetFindingSettingByResource(ctx context.Context, projectID uint32, resourceName string) (*model.FindingSetting, error)

func (*MockFindingRepository) GetFindingTagByID

func (*MockFindingRepository) GetFindingTagByKey

func (*MockFindingRepository) GetPendFinding

func (*MockFindingRepository) GetRecommend

func (m *MockFindingRepository) GetRecommend(ctx context.Context, projectID uint32, findingID uint64) (*model.Recommend, error)

func (*MockFindingRepository) GetRecommendByDataSourceType

func (m *MockFindingRepository) GetRecommendByDataSourceType(ctx context.Context, dataSource, recommendType string) (*model.Recommend, error)

func (*MockFindingRepository) GetResource

func (*MockFindingRepository) GetResourceByName

func (m *MockFindingRepository) GetResourceByName(context.Context, uint32, string) (*model.Resource, error)

func (*MockFindingRepository) GetResourceTagByID

func (*MockFindingRepository) GetResourceTagByKey

func (*MockFindingRepository) ListFinding

func (*MockFindingRepository) ListFindingCount

func (m *MockFindingRepository) ListFindingCount(
	ctx context.Context,
	projectID uint32,
	fromScore, toScore float32,
	fromAt, toAt int64,
	findingID uint64,
	dataSources, resourceNames, tags []string,
	status finding.FindingStatus) (int64, error)

func (*MockFindingRepository) ListFindingSetting

func (*MockFindingRepository) ListFindingTag

func (*MockFindingRepository) ListFindingTagByFindingID

func (m *MockFindingRepository) ListFindingTagByFindingID(ctx context.Context, projectID uint32, findingID uint64) (*[]model.FindingTag, error)

func (*MockFindingRepository) ListFindingTagCount

func (m *MockFindingRepository) ListFindingTagCount(ctx context.Context, param *finding.ListFindingTagRequest) (int64, error)

func (*MockFindingRepository) ListFindingTagName

func (m *MockFindingRepository) ListFindingTagName(ctx context.Context, param *finding.ListFindingTagNameRequest) (*[]db.TagName, error)

func (*MockFindingRepository) ListFindingTagNameCount

func (m *MockFindingRepository) ListFindingTagNameCount(ctx context.Context, param *finding.ListFindingTagNameRequest) (int64, error)

func (*MockFindingRepository) ListResource

func (*MockFindingRepository) ListResourceCount

func (m *MockFindingRepository) ListResourceCount(ctx context.Context, req *finding.ListResourceRequest) (int64, error)

func (*MockFindingRepository) ListResourceTag

func (*MockFindingRepository) ListResourceTagByResourceID

func (m *MockFindingRepository) ListResourceTagByResourceID(ctx context.Context, projectID uint32, resourceID uint64) (*[]model.ResourceTag, error)

func (*MockFindingRepository) ListResourceTagCount

func (m *MockFindingRepository) ListResourceTagCount(ctx context.Context, param *finding.ListResourceTagRequest) (int64, error)

func (*MockFindingRepository) ListResourceTagName

func (m *MockFindingRepository) ListResourceTagName(ctx context.Context, param *finding.ListResourceTagNameRequest) (*[]db.TagName, error)

func (*MockFindingRepository) ListResourceTagNameCount

func (m *MockFindingRepository) ListResourceTagNameCount(ctx context.Context, param *finding.ListResourceTagNameRequest) (int64, error)

func (*MockFindingRepository) TagFinding

func (*MockFindingRepository) TagResource

func (*MockFindingRepository) UntagFinding

func (*MockFindingRepository) UntagResource

func (*MockFindingRepository) UpsertFinding

func (*MockFindingRepository) UpsertFindingSetting

func (m *MockFindingRepository) UpsertFindingSetting(ctx context.Context, data *model.FindingSetting) (*model.FindingSetting, error)

func (*MockFindingRepository) UpsertPendFinding

func (*MockFindingRepository) UpsertRecommend

func (m *MockFindingRepository) UpsertRecommend(ctx context.Context, data *model.Recommend) (*model.Recommend, error)

func (*MockFindingRepository) UpsertRecommendFinding

func (m *MockFindingRepository) UpsertRecommendFinding(ctx context.Context, data *model.RecommendFinding) (*model.RecommendFinding, error)

func (*MockFindingRepository) UpsertResource

type MockIAMRepository

type MockIAMRepository struct {
	mock.Mock
}

* Mock Repository

func (*MockIAMRepository) AttachAccessTokenRole

func (m *MockIAMRepository) AttachAccessTokenRole(ctx context.Context, projectID, roleID, accessTokenID uint32) (*model.AccessTokenRole, error)

func (*MockIAMRepository) AttachAllAdminRole

func (m *MockIAMRepository) AttachAllAdminRole(context.Context, uint32) error

func (*MockIAMRepository) AttachPolicy

func (*MockIAMRepository) AttachRole

func (*MockIAMRepository) DeleteAccessToken

func (m *MockIAMRepository) DeleteAccessToken(ctx context.Context, projectID, accessTokenID uint32) error

func (*MockIAMRepository) DeletePolicy

func (m *MockIAMRepository) DeletePolicy(context.Context, uint32, uint32) error

func (*MockIAMRepository) DeleteRole

func (*MockIAMRepository) DetachAccessTokenRole

func (m *MockIAMRepository) DetachAccessTokenRole(ctx context.Context, projectID, roleID, accessTokenID uint32) error

func (*MockIAMRepository) DetachPolicy

func (*MockIAMRepository) DetachRole

func (*MockIAMRepository) ExistsAccessTokenMaintainer

func (m *MockIAMRepository) ExistsAccessTokenMaintainer(ctx context.Context, projectID, accessTokenID uint32) (bool, error)

func (*MockIAMRepository) GetAccessTokenByID

func (m *MockIAMRepository) GetAccessTokenByID(ctx context.Context, projectID, accessTokenID uint32) (*model.AccessToken, error)

func (*MockIAMRepository) GetAccessTokenByUniqueKey

func (m *MockIAMRepository) GetAccessTokenByUniqueKey(ctx context.Context, projectID uint32, name string) (*model.AccessToken, error)

func (*MockIAMRepository) GetAccessTokenRole

func (m *MockIAMRepository) GetAccessTokenRole(ctx context.Context, accessTokenID, roleID uint32) (*model.AccessTokenRole, error)

func (*MockIAMRepository) GetActiveAccessTokenHash

func (m *MockIAMRepository) GetActiveAccessTokenHash(ctx context.Context, projectID, accessTokenID uint32, tokenHash string) (*model.AccessToken, error)

func (*MockIAMRepository) GetActiveUserCount

func (m *MockIAMRepository) GetActiveUserCount(ctx context.Context) (*int, error)

func (*MockIAMRepository) GetAdminPolicy

func (m *MockIAMRepository) GetAdminPolicy(context.Context, uint32) (*[]model.Policy, error)

func (*MockIAMRepository) GetPolicy

func (*MockIAMRepository) GetPolicyByName

func (m *MockIAMRepository) GetPolicyByName(context.Context, uint32, string) (*model.Policy, error)

func (*MockIAMRepository) GetRole

func (*MockIAMRepository) GetRoleByName

func (m *MockIAMRepository) GetRoleByName(context.Context, uint32, string) (*model.Role, error)

func (*MockIAMRepository) GetTokenPolicy

func (m *MockIAMRepository) GetTokenPolicy(context.Context, uint32) (*[]model.Policy, error)

func (*MockIAMRepository) GetUser

func (*MockIAMRepository) GetUserBySub

func (m *MockIAMRepository) GetUserBySub(context.Context, string) (*model.User, error)

func (*MockIAMRepository) GetUserPolicy

func (m *MockIAMRepository) GetUserPolicy(context.Context, uint32) (*[]model.Policy, error)

func (*MockIAMRepository) ListAccessToken

func (m *MockIAMRepository) ListAccessToken(ctx context.Context, projectID uint32, name string, accessTokenID uint32) (*[]model.AccessToken, error)

func (*MockIAMRepository) ListExpiredAccessToken

func (m *MockIAMRepository) ListExpiredAccessToken(ctx context.Context) (*[]model.AccessToken, error)

func (*MockIAMRepository) ListPolicy

func (*MockIAMRepository) ListRole

func (m *MockIAMRepository) ListRole(ctx context.Context, projectID uint32, name string, userID uint32, accessTokenID uint32) (*[]model.Role, error)

func (*MockIAMRepository) ListUser

func (m *MockIAMRepository) ListUser(ctx context.Context, activated bool, projectID uint32, name string, userID uint32, admin bool) (*[]model.User, error)

func (*MockIAMRepository) PutAccessToken

func (m *MockIAMRepository) PutAccessToken(ctx context.Context, r *model.AccessToken) (*model.AccessToken, error)

func (*MockIAMRepository) PutPolicy

func (*MockIAMRepository) PutRole

func (m *MockIAMRepository) PutRole(ctx context.Context, r *model.Role) (*model.Role, error)

func (*MockIAMRepository) PutUser

type MockProjectRepository

type MockProjectRepository struct {
	mock.Mock
}

*

  • Mock Repository

*

func (*MockProjectRepository) CreateProject

func (m *MockProjectRepository) CreateProject(ctx context.Context, name string) (*model.Project, error)

func (*MockProjectRepository) ListProject

func (m *MockProjectRepository) ListProject(ctx context.Context, userID, projectID uint32, name string) (*[]db.ProjectWithTag, error)

func (*MockProjectRepository) ListProjectTag

func (m *MockProjectRepository) ListProjectTag(ctx context.Context, projectID uint32) (*[]model.ProjectTag, error)

func (*MockProjectRepository) TagProject

func (m *MockProjectRepository) TagProject(ctx context.Context, projectID uint32, tag, color string) (*model.ProjectTag, error)

func (*MockProjectRepository) UntagProject

func (m *MockProjectRepository) UntagProject(ctx context.Context, projectID uint32, tag string) error

func (*MockProjectRepository) UpdateProject

func (m *MockProjectRepository) UpdateProject(ctx context.Context, projectID uint32, name string) (*model.Project, error)

type MockReportRepository

type MockReportRepository struct {
	mock.Mock
}

* Mock Repository

func (*MockReportRepository) CollectReportFinding

func (m *MockReportRepository) CollectReportFinding(ctx context.Context) error

func (*MockReportRepository) GetReportFinding

func (*MockReportRepository) GetReportFindingAll

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL