alert

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

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 (a *AlertService) AnalyzeAlertAll(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)

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 (*AlertService) GetAlertCondRule

func (*AlertService) GetAlertCondition

func (*AlertService) GetAlertHistory

func (*AlertService) GetAlertRule

func (*AlertService) GetNotification

func (*AlertService) GetRelAlertFinding

func (*AlertService) ListAlert

func (*AlertService) ListAlertCondRule

func (*AlertService) ListAlertCondition

func (*AlertService) ListAlertHistory

func (*AlertService) ListAlertRule

func (*AlertService) ListNotification

func (*AlertService) ListNotificationForInternal added in v0.9.0

func (*AlertService) ListRelAlertFinding

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 (*AlertService) PutAlertCondRule

func (*AlertService) PutAlertCondition

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 (*AlertService) PutAlertRule

func (*AlertService) PutNotification

func (*AlertService) PutRelAlertFinding

func (*AlertService) RegistAlertByAnalyze

func (a *AlertService) RegistAlertByAnalyze(ctx context.Context, alertCondition *model.AlertCondition, findingIDs []uint64) (*model.Alert, bool, error)

RegistAlertByAnalyze アラートを登録・更新します。既に登録済みのアラートがある場合は処理をスキップします。 Return:

  1. *model.Alert (登録したアラート)
  2. bool (新規Findingがあったかどうか)
  3. 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"`
}

Jump to

Keyboard shortcuts

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