service.go 1.49 KB
Newer Older
qiuqunfeng's avatar
qiuqunfeng committed
1 2 3 4 5 6
package service

import "context"

type Service interface {
	// QueryIP(ip string) (*model.IPInfo, error)
qiuqunfeng's avatar
qiuqunfeng committed
7
	GetWaf(ctx context.Context, regionCode, namespace, gatewayName string) (*WafService, error)
8
	ListWafs(ctx context.Context) ([]WafService, error)
9
	GetWafGatewayInfo(ctx context.Context, req *GetWafGatewayInfoReq) (*WafService, error)
qiuqunfeng's avatar
qiuqunfeng committed
10 11 12
	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
13
	SaveRuleCategoryToDB(ctx context.Context) error
qiuqunfeng's avatar
qiuqunfeng committed
14 15 16 17
	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
18
	EnableListenerWafs(ctx context.Context, req *EnableListenerWafsReq) error
19 20
	ListAttackLogs(ctx context.Context, req *AttackLogFilter) ([]AttackLog, string, error)
	ListRules(ctx context.Context, regionCode, namespace, gatewayName, language, name string) ([]RuleGroupResp, error)
21 22 23
	CreateBlackWhiteList(ctx context.Context, req *MatcherExpr) error
	UpdateBlackWhiteList(ctx context.Context, req *MatcherExpr) error
	EnableBlackWhiteList(ctx context.Context, req *MatcherExpr) error
24 25
	DeleteBlackWhiteList(ctx context.Context, ID uint32) error
	GetBlackWhiteLists(ctx context.Context, query *MatchExprQueryOption, limit int, offset int) ([]MatcherExpr, error)
qiuqunfeng's avatar
qiuqunfeng committed
26
}