service.go 1.71 KB
Newer Older
qiuqunfeng's avatar
qiuqunfeng committed
1 2
package service

3 4 5 6 7
import (
	"context"

	"gitlab.com/tensorsecurity-rd/waf-console/internal/model"
)
qiuqunfeng's avatar
qiuqunfeng committed
8 9

type Service interface {
qiuqunfeng's avatar
qiuqunfeng committed
10
	GetWaf(ctx context.Context, regionCode, namespace, gatewayName string) (*WafService, error)
11
	ListWafs(ctx context.Context) ([]WafService, error)
12
	GetWafGatewayInfo(ctx context.Context, req *GetWafGatewayInfoReq) (*WafService, error)
qiuqunfeng's avatar
qiuqunfeng committed
13 14 15
	CreateWaf(ctx context.Context, req *CreateWafReq) (*WafService, error)
	UpdateMode(ctx context.Context, req *UpdateModeReq) (*WafService, error)
	UpdateRule(ctx context.Context, req *RuleRequest) error
qiuqunfeng's avatar
commit  
qiuqunfeng committed
16
	SaveRuleCategoryToDB(ctx context.Context) error
qiuqunfeng's avatar
qiuqunfeng committed
17 18 19 20
	EnableListenerWaf(ctx context.Context, req *EnableListenerWafReq) error
	EnableGatewayWaf(ctx context.Context, req *EnableGatewayWafReq) error
	DeleteGatewayWaf(ctx context.Context, req *GatewateInfo) error
	DeleteListenerWaf(ctx context.Context, req *DeleteListenerReq) error
21
	EnableListenerWafs(ctx context.Context, req *EnableListenerWafsReq) error
22 23
	ListAttackLogs(ctx context.Context, req *AttackLogFilter) ([]AttackLog, string, error)
	ListRules(ctx context.Context, regionCode, namespace, gatewayName, language, name string) ([]RuleGroupResp, error)
24 25 26
	CreateBlackWhiteList(ctx context.Context, req *MatcherExpr) error
	UpdateBlackWhiteList(ctx context.Context, req *MatcherExpr) error
	EnableBlackWhiteList(ctx context.Context, req *MatcherExpr) error
27
	DeleteBlackWhiteList(ctx context.Context, ID uint32) error
28
	GetBlackWhiteLists(ctx context.Context, query *MatchExprQueryOption, limit int, offset int) ([]MatcherExpr, int, error)
29
	ListListenerHistory(ctx context.Context, query *WafListenerHistoryOption, limit, offset int) ([]model.WafListenerHistory, int, error)
30
	ListAttackClasses(ctx context.Context, lang string) []AttackClasses
qiuqunfeng's avatar
qiuqunfeng committed
31
}