Documentation ¶
Index ¶
- Constants
- type AlertService
- func (a *AlertService) AnalyzeAlert(ctx context.Context, req *alert.AnalyzeAlertRequest) (*empty.Empty, error)
- func (a *AlertService) AnalyzeAlertAll(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)
- func (a *AlertService) AnalyzeAlertByCondition(ctx context.Context, alertCondition *model.AlertCondition, ...) error
- func (a *AlertService) DeleteAlert(ctx context.Context, req *alert.DeleteAlertRequest) (*empty.Empty, error)
- func (a *AlertService) DeleteAlertByAnalyze(ctx context.Context, alertCondition *model.AlertCondition) error
- func (a *AlertService) DeleteAlertCondNotification(ctx context.Context, req *alert.DeleteAlertCondNotificationRequest) (*empty.Empty, error)
- func (a *AlertService) DeleteAlertCondRule(ctx context.Context, req *alert.DeleteAlertCondRuleRequest) (*empty.Empty, error)
- func (a *AlertService) DeleteAlertCondition(ctx context.Context, req *alert.DeleteAlertConditionRequest) (*empty.Empty, error)
- func (a *AlertService) DeleteAlertHistory(ctx context.Context, req *alert.DeleteAlertHistoryRequest) (*empty.Empty, error)
- func (a *AlertService) DeleteAlertRule(ctx context.Context, req *alert.DeleteAlertRuleRequest) (*empty.Empty, error)
- func (a *AlertService) DeleteNotification(ctx context.Context, req *alert.DeleteNotificationRequest) (*empty.Empty, error)
- func (a *AlertService) DeleteRelAlertFinding(ctx context.Context, req *alert.DeleteRelAlertFindingRequest) (*empty.Empty, error)
- func (a *AlertService) GetAlert(ctx context.Context, req *alert.GetAlertRequest) (*alert.GetAlertResponse, error)
- func (a *AlertService) GetAlertCondNotification(ctx context.Context, req *alert.GetAlertCondNotificationRequest) (*alert.GetAlertCondNotificationResponse, error)
- func (a *AlertService) GetAlertCondRule(ctx context.Context, req *alert.GetAlertCondRuleRequest) (*alert.GetAlertCondRuleResponse, error)
- func (a *AlertService) GetAlertCondition(ctx context.Context, req *alert.GetAlertConditionRequest) (*alert.GetAlertConditionResponse, error)
- func (a *AlertService) GetAlertHistory(ctx context.Context, req *alert.GetAlertHistoryRequest) (*alert.GetAlertHistoryResponse, error)
- func (a *AlertService) GetAlertRule(ctx context.Context, req *alert.GetAlertRuleRequest) (*alert.GetAlertRuleResponse, error)
- func (a *AlertService) GetNotification(ctx context.Context, req *alert.GetNotificationRequest) (*alert.GetNotificationResponse, error)
- func (a *AlertService) GetRelAlertFinding(ctx context.Context, req *alert.GetRelAlertFindingRequest) (*alert.GetRelAlertFindingResponse, error)
- func (a *AlertService) ListAlert(ctx context.Context, req *alert.ListAlertRequest) (*alert.ListAlertResponse, error)
- func (a *AlertService) ListAlertCondNotification(ctx context.Context, req *alert.ListAlertCondNotificationRequest) (*alert.ListAlertCondNotificationResponse, error)
- func (a *AlertService) ListAlertCondRule(ctx context.Context, req *alert.ListAlertCondRuleRequest) (*alert.ListAlertCondRuleResponse, error)
- func (a *AlertService) ListAlertCondition(ctx context.Context, req *alert.ListAlertConditionRequest) (*alert.ListAlertConditionResponse, error)
- func (a *AlertService) ListAlertHistory(ctx context.Context, req *alert.ListAlertHistoryRequest) (*alert.ListAlertHistoryResponse, error)
- func (a *AlertService) ListAlertRule(ctx context.Context, req *alert.ListAlertRuleRequest) (*alert.ListAlertRuleResponse, error)
- func (a *AlertService) ListNotification(ctx context.Context, req *alert.ListNotificationRequest) (*alert.ListNotificationResponse, error)
- func (a *AlertService) ListNotificationForInternal(ctx context.Context, req *alert.ListNotificationForInternalRequest) (*alert.ListNotificationForInternalResponse, error)
- func (a *AlertService) ListRelAlertFinding(ctx context.Context, req *alert.ListRelAlertFindingRequest) (*alert.ListRelAlertFindingResponse, error)
- func (a *AlertService) NotificationAlert(ctx context.Context, alertCondition *model.AlertCondition, alert *model.Alert, ...) error
- func (a *AlertService) PutAlert(ctx context.Context, req *alert.PutAlertRequest) (*alert.PutAlertResponse, error)
- func (a *AlertService) PutAlertCondNotification(ctx context.Context, req *alert.PutAlertCondNotificationRequest) (*alert.PutAlertCondNotificationResponse, error)
- func (a *AlertService) PutAlertCondRule(ctx context.Context, req *alert.PutAlertCondRuleRequest) (*alert.PutAlertCondRuleResponse, error)
- func (a *AlertService) PutAlertCondition(ctx context.Context, req *alert.PutAlertConditionRequest) (*alert.PutAlertConditionResponse, error)
- func (a *AlertService) PutAlertFirstViewedAt(ctx context.Context, req *alert.PutAlertFirstViewedAtRequest) (*empty.Empty, error)
- func (a *AlertService) PutAlertHistory(ctx context.Context, req *alert.PutAlertHistoryRequest) (*alert.PutAlertHistoryResponse, error)
- func (a *AlertService) PutAlertRule(ctx context.Context, req *alert.PutAlertRuleRequest) (*alert.PutAlertRuleResponse, error)
- func (a *AlertService) PutNotification(ctx context.Context, req *alert.PutNotificationRequest) (*alert.PutNotificationResponse, error)
- func (a *AlertService) PutRelAlertFinding(ctx context.Context, req *alert.PutRelAlertFindingRequest) (*alert.PutRelAlertFindingResponse, error)
- func (a *AlertService) RegistAlertByAnalyze(ctx context.Context, alertCondition *model.AlertCondition, findingIDs []uint64) (*model.Alert, bool, error)
- func (a *AlertService) TestNotification(ctx context.Context, req *alert.TestNotificationRequest) (*empty.Empty, error)
- type FindingHistory
Constants ¶
View Source
const ( LocaleJa = "ja" LocaleEn = "en" )
View Source
const (
MAX_NOTIFY_FINDING_NUM = 3
)
View Source
const (
MAX_NOTIFY_FINDING_TAG_NUM = 15
)
View Source
const (
MAX_NOTIFY_RULE_NUM = 3
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertService ¶
type AlertService struct {
// contains filtered or unexported fields
}
func NewAlertService ¶
func NewAlertService( maxAnalyzeAPICall int64, baseURL string, findingClient finding.FindingServiceClient, projectClient project.ProjectServiceClient, repository db.AlertRepository, logger logging.Logger, defaultLocale string, ) *AlertService
func (*AlertService) AnalyzeAlert ¶
func (a *AlertService) AnalyzeAlert(ctx context.Context, req *alert.AnalyzeAlertRequest) (*empty.Empty, error)
func (*AlertService) AnalyzeAlertAll ¶
func (*AlertService) AnalyzeAlertByCondition ¶
func (a *AlertService) AnalyzeAlertByCondition(ctx context.Context, alertCondition *model.AlertCondition, project *projectproto.Project) error
func (*AlertService) DeleteAlert ¶
func (a *AlertService) DeleteAlert(ctx context.Context, req *alert.DeleteAlertRequest) (*empty.Empty, error)
func (*AlertService) DeleteAlertByAnalyze ¶
func (a *AlertService) DeleteAlertByAnalyze(ctx context.Context, alertCondition *model.AlertCondition) error
func (*AlertService) DeleteAlertCondNotification ¶
func (a *AlertService) DeleteAlertCondNotification(ctx context.Context, req *alert.DeleteAlertCondNotificationRequest) (*empty.Empty, error)
func (*AlertService) DeleteAlertCondRule ¶
func (a *AlertService) DeleteAlertCondRule(ctx context.Context, req *alert.DeleteAlertCondRuleRequest) (*empty.Empty, error)
func (*AlertService) DeleteAlertCondition ¶
func (a *AlertService) DeleteAlertCondition(ctx context.Context, req *alert.DeleteAlertConditionRequest) (*empty.Empty, error)
func (*AlertService) DeleteAlertHistory ¶
func (a *AlertService) DeleteAlertHistory(ctx context.Context, req *alert.DeleteAlertHistoryRequest) (*empty.Empty, error)
func (*AlertService) DeleteAlertRule ¶
func (a *AlertService) DeleteAlertRule(ctx context.Context, req *alert.DeleteAlertRuleRequest) (*empty.Empty, error)
func (*AlertService) DeleteNotification ¶
func (a *AlertService) DeleteNotification(ctx context.Context, req *alert.DeleteNotificationRequest) (*empty.Empty, error)
func (*AlertService) DeleteRelAlertFinding ¶
func (a *AlertService) DeleteRelAlertFinding(ctx context.Context, req *alert.DeleteRelAlertFindingRequest) (*empty.Empty, error)
func (*AlertService) GetAlert ¶
func (a *AlertService) GetAlert(ctx context.Context, req *alert.GetAlertRequest) (*alert.GetAlertResponse, error)
func (*AlertService) GetAlertCondNotification ¶
func (a *AlertService) GetAlertCondNotification(ctx context.Context, req *alert.GetAlertCondNotificationRequest) (*alert.GetAlertCondNotificationResponse, error)
func (*AlertService) GetAlertCondRule ¶
func (a *AlertService) GetAlertCondRule(ctx context.Context, req *alert.GetAlertCondRuleRequest) (*alert.GetAlertCondRuleResponse, error)
func (*AlertService) GetAlertCondition ¶
func (a *AlertService) GetAlertCondition(ctx context.Context, req *alert.GetAlertConditionRequest) (*alert.GetAlertConditionResponse, error)
func (*AlertService) GetAlertHistory ¶
func (a *AlertService) GetAlertHistory(ctx context.Context, req *alert.GetAlertHistoryRequest) (*alert.GetAlertHistoryResponse, error)
func (*AlertService) GetAlertRule ¶
func (a *AlertService) GetAlertRule(ctx context.Context, req *alert.GetAlertRuleRequest) (*alert.GetAlertRuleResponse, error)
func (*AlertService) GetNotification ¶
func (a *AlertService) GetNotification(ctx context.Context, req *alert.GetNotificationRequest) (*alert.GetNotificationResponse, error)
func (*AlertService) GetRelAlertFinding ¶
func (a *AlertService) GetRelAlertFinding(ctx context.Context, req *alert.GetRelAlertFindingRequest) (*alert.GetRelAlertFindingResponse, error)
func (*AlertService) ListAlert ¶
func (a *AlertService) ListAlert(ctx context.Context, req *alert.ListAlertRequest) (*alert.ListAlertResponse, error)
func (*AlertService) ListAlertCondNotification ¶
func (a *AlertService) ListAlertCondNotification(ctx context.Context, req *alert.ListAlertCondNotificationRequest) (*alert.ListAlertCondNotificationResponse, error)
func (*AlertService) ListAlertCondRule ¶
func (a *AlertService) ListAlertCondRule(ctx context.Context, req *alert.ListAlertCondRuleRequest) (*alert.ListAlertCondRuleResponse, error)
func (*AlertService) ListAlertCondition ¶
func (a *AlertService) ListAlertCondition(ctx context.Context, req *alert.ListAlertConditionRequest) (*alert.ListAlertConditionResponse, error)
func (*AlertService) ListAlertHistory ¶
func (a *AlertService) ListAlertHistory(ctx context.Context, req *alert.ListAlertHistoryRequest) (*alert.ListAlertHistoryResponse, error)
func (*AlertService) ListAlertRule ¶
func (a *AlertService) ListAlertRule(ctx context.Context, req *alert.ListAlertRuleRequest) (*alert.ListAlertRuleResponse, error)
func (*AlertService) ListNotification ¶
func (a *AlertService) ListNotification(ctx context.Context, req *alert.ListNotificationRequest) (*alert.ListNotificationResponse, error)
func (*AlertService) ListNotificationForInternal ¶ added in v0.9.0
func (a *AlertService) ListNotificationForInternal(ctx context.Context, req *alert.ListNotificationForInternalRequest) (*alert.ListNotificationForInternalResponse, error)
func (*AlertService) ListRelAlertFinding ¶
func (a *AlertService) ListRelAlertFinding(ctx context.Context, req *alert.ListRelAlertFindingRequest) (*alert.ListRelAlertFindingResponse, error)
func (*AlertService) NotificationAlert ¶
func (a *AlertService) NotificationAlert( ctx context.Context, alertCondition *model.AlertCondition, alert *model.Alert, rules *[]model.AlertRule, project *projectproto.Project, findingIDs *[]uint64, existsNewFindings bool, ) error
func (*AlertService) PutAlert ¶
func (a *AlertService) PutAlert(ctx context.Context, req *alert.PutAlertRequest) (*alert.PutAlertResponse, error)
func (*AlertService) PutAlertCondNotification ¶
func (a *AlertService) PutAlertCondNotification(ctx context.Context, req *alert.PutAlertCondNotificationRequest) (*alert.PutAlertCondNotificationResponse, error)
func (*AlertService) PutAlertCondRule ¶
func (a *AlertService) PutAlertCondRule(ctx context.Context, req *alert.PutAlertCondRuleRequest) (*alert.PutAlertCondRuleResponse, error)
func (*AlertService) PutAlertCondition ¶
func (a *AlertService) PutAlertCondition(ctx context.Context, req *alert.PutAlertConditionRequest) (*alert.PutAlertConditionResponse, error)
func (*AlertService) PutAlertFirstViewedAt ¶ added in v0.10.0
func (a *AlertService) PutAlertFirstViewedAt(ctx context.Context, req *alert.PutAlertFirstViewedAtRequest) (*empty.Empty, error)
func (*AlertService) PutAlertHistory ¶
func (a *AlertService) PutAlertHistory(ctx context.Context, req *alert.PutAlertHistoryRequest) (*alert.PutAlertHistoryResponse, error)
func (*AlertService) PutAlertRule ¶
func (a *AlertService) PutAlertRule(ctx context.Context, req *alert.PutAlertRuleRequest) (*alert.PutAlertRuleResponse, error)
func (*AlertService) PutNotification ¶
func (a *AlertService) PutNotification(ctx context.Context, req *alert.PutNotificationRequest) (*alert.PutNotificationResponse, error)
func (*AlertService) PutRelAlertFinding ¶
func (a *AlertService) PutRelAlertFinding(ctx context.Context, req *alert.PutRelAlertFindingRequest) (*alert.PutRelAlertFindingResponse, error)
func (*AlertService) RegistAlertByAnalyze ¶
func (a *AlertService) RegistAlertByAnalyze(ctx context.Context, alertCondition *model.AlertCondition, findingIDs []uint64) (*model.Alert, bool, error)
RegistAlertByAnalyze アラートを登録・更新します。既に登録済みのアラートがある場合は処理をスキップします。 Return:
- *model.Alert (登録したアラート)
- bool (新規Findingがあったかどうか)
- error (エラー)
func (*AlertService) TestNotification ¶
func (a *AlertService) TestNotification(ctx context.Context, req *alert.TestNotificationRequest) (*empty.Empty, error)
type FindingHistory ¶ added in v0.6.0
type FindingHistory struct {
FindingIDs []uint32 `json:"finding_id"`
}
Click to show internal directories.
Click to hide internal directories.