集群可以设置默认的WAF策略、缓存策略

This commit is contained in:
GoEdgeLab
2020-12-17 15:50:44 +08:00
parent ee549b945d
commit 41ac159e23
100 changed files with 1172 additions and 488 deletions

View File

@@ -0,0 +1,21 @@
package models
import (
"context"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
var SharedNodeClusterDAO = new(NodeClusterDAO)
type NodeClusterDAO struct {
BaseDAO
}
// 查找集群
func (this *NodeClusterDAO) FindEnabledNodeCluster(ctx context.Context, clusterId int64) (*pb.NodeCluster, error) {
clusterResp, err := this.RPC().NodeClusterRPC().FindEnabledNodeCluster(ctx, &pb.FindEnabledNodeClusterRequest{NodeClusterId: clusterId})
if err != nil {
return nil, err
}
return clusterResp.Cluster, nil
}