Archived
阶段性提交
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package dao
|
||||
|
||||
type BaseDAO struct {
|
||||
}
|
||||
|
||||
func (this *BaseDAO) RPC() RPCClient {
|
||||
return sharedRPCClient
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
)
|
||||
|
||||
var SharedHTTPCachePolicyDAO = new(HTTPCachePolicyDAO)
|
||||
|
||||
type HTTPCachePolicyDAO struct {
|
||||
BaseDAO
|
||||
}
|
||||
|
||||
// 查找缓存策略配置
|
||||
func (this *HTTPCachePolicyDAO) FindEnabledHTTPCachePolicyConfig(ctx context.Context, cachePolicyId int64) (*serverconfigs.HTTPCachePolicy, error) {
|
||||
resp, err := this.RPC().HTTPCachePolicyRPC().FindEnabledHTTPCachePolicyConfig(ctx, &pb.FindEnabledHTTPCachePolicyConfigRequest{HttpCachePolicyId: cachePolicyId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(resp.HttpCachePolicyJSON) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
config := &serverconfigs.HTTPCachePolicy{}
|
||||
err = json.Unmarshal(resp.HttpCachePolicyJSON, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// 查找缓存策略信息
|
||||
func (this *HTTPCachePolicyDAO) FindEnabledHTTPCachePolicy(ctx context.Context, cachePolicyId int64) (*pb.HTTPCachePolicy, error) {
|
||||
resp, err := this.RPC().HTTPCachePolicyRPC().FindEnabledHTTPCachePolicy(ctx, &pb.FindEnabledHTTPCachePolicyRequest{
|
||||
HttpCachePolicyId: cachePolicyId,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.HttpCachePolicy, nil
|
||||
}
|
||||
|
||||
// 根据服务ID查找缓存策略
|
||||
func (this *HTTPCachePolicyDAO) FindEnabledHTTPCachePolicyWithServerId(ctx context.Context, serverId int64) (*pb.HTTPCachePolicy, error) {
|
||||
serverResp, err := this.RPC().ServerRPC().FindEnabledServer(ctx, &pb.FindEnabledServerRequest{ServerId: serverId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
server := serverResp.Server
|
||||
if server == nil {
|
||||
return nil, nil
|
||||
}
|
||||
if server.NodeCluster == nil {
|
||||
return nil, nil
|
||||
}
|
||||
clusterId := server.NodeCluster.Id
|
||||
cluster, err := SharedNodeClusterDAO.FindEnabledNodeCluster(ctx, clusterId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if cluster == nil {
|
||||
return nil, nil
|
||||
}
|
||||
if cluster.HttpCachePolicyId == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return this.FindEnabledHTTPCachePolicy(ctx, cluster.HttpCachePolicyId)
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ipconfigs"
|
||||
)
|
||||
|
||||
var SharedHTTPFirewallPolicyDAO = new(HTTPFirewallPolicyDAO)
|
||||
|
||||
// WAF策略相关
|
||||
type HTTPFirewallPolicyDAO struct {
|
||||
BaseDAO
|
||||
}
|
||||
|
||||
// 查找WAF策略基本信息
|
||||
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicy(ctx context.Context, policyId int64) (*pb.HTTPFirewallPolicy, error) {
|
||||
resp, err := this.RPC().HTTPFirewallPolicyRPC().FindEnabledHTTPFirewallPolicy(ctx, &pb.FindEnabledHTTPFirewallPolicyRequest{HttpFirewallPolicyId: policyId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return resp.HttpFirewallPolicy, nil
|
||||
}
|
||||
|
||||
// 查找WAF策略配置
|
||||
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyConfig(ctx context.Context, policyId int64) (*firewallconfigs.HTTPFirewallPolicy, error) {
|
||||
resp, err := this.RPC().HTTPFirewallPolicyRPC().FindEnabledHTTPFirewallPolicyConfig(ctx, &pb.FindEnabledHTTPFirewallPolicyConfigRequest{HttpFirewallPolicyId: policyId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(resp.HttpFirewallPolicyJSON) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
firewallPolicy := &firewallconfigs.HTTPFirewallPolicy{}
|
||||
err = json.Unmarshal(resp.HttpFirewallPolicyJSON, firewallPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return firewallPolicy, nil
|
||||
}
|
||||
|
||||
// 查找WAF的Inbound
|
||||
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyInboundConfig(ctx context.Context, policyId int64) (*firewallconfigs.HTTPFirewallInboundConfig, error) {
|
||||
config, err := this.FindEnabledHTTPFirewallPolicyConfig(ctx, policyId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if config == nil {
|
||||
return nil, errors.New("not found")
|
||||
}
|
||||
return config.Inbound, nil
|
||||
}
|
||||
|
||||
// 根据类型查找WAF的IP名单
|
||||
func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyIPListIdWithType(ctx context.Context, policyId int64, listType ipconfigs.IPListType) (int64, error) {
|
||||
switch listType {
|
||||
case ipconfigs.IPListTypeWhite:
|
||||
return this.FindEnabledPolicyWhiteIPListId(ctx, policyId)
|
||||
case ipconfigs.IPListTypeBlack:
|
||||
return this.FindEnabledPolicyBlackIPListId(ctx, policyId)
|
||||
default:
|
||||
return 0, errors.New("invalid ip list type '" + listType + "'")
|
||||
}
|
||||
}
|
||||
|
||||
// 查找WAF的白名单
|
||||
func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyWhiteIPListId(ctx context.Context, policyId int64) (int64, error) {
|
||||
config, err := this.FindEnabledHTTPFirewallPolicyConfig(ctx, policyId)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if config == nil {
|
||||
return 0, errors.New("not found")
|
||||
}
|
||||
if config.Inbound == nil {
|
||||
config.Inbound = &firewallconfigs.HTTPFirewallInboundConfig{IsOn: true}
|
||||
}
|
||||
if config.Inbound.WhiteListRef == nil || config.Inbound.WhiteListRef.ListId == 0 {
|
||||
createResp, err := this.RPC().IPListRPC().CreateIPList(ctx, &pb.CreateIPListRequest{
|
||||
Type: "white",
|
||||
Name: "白名单",
|
||||
Code: "white",
|
||||
TimeoutJSON: nil,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
listId := createResp.IpListId
|
||||
config.Inbound.WhiteListRef = &ipconfigs.IPListRef{
|
||||
IsOn: true,
|
||||
ListId: listId,
|
||||
}
|
||||
inboundJSON, err := json.Marshal(config.Inbound)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
_, err = this.RPC().HTTPFirewallPolicyRPC().UpdateHTTPFirewallInboundConfig(ctx, &pb.UpdateHTTPFirewallInboundConfigRequest{
|
||||
HttpFirewallPolicyId: policyId,
|
||||
InboundJSON: inboundJSON,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return listId, nil
|
||||
}
|
||||
|
||||
return config.Inbound.WhiteListRef.ListId, nil
|
||||
}
|
||||
|
||||
// 查找WAF的黑名单
|
||||
func (this *HTTPFirewallPolicyDAO) FindEnabledPolicyBlackIPListId(ctx context.Context, policyId int64) (int64, error) {
|
||||
config, err := this.FindEnabledHTTPFirewallPolicyConfig(ctx, policyId)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if config == nil {
|
||||
return 0, errors.New("not found")
|
||||
}
|
||||
if config.Inbound == nil {
|
||||
config.Inbound = &firewallconfigs.HTTPFirewallInboundConfig{IsOn: true}
|
||||
}
|
||||
if config.Inbound.BlackListRef == nil || config.Inbound.BlackListRef.ListId == 0 {
|
||||
createResp, err := this.RPC().IPListRPC().CreateIPList(ctx, &pb.CreateIPListRequest{
|
||||
Type: "black",
|
||||
Name: "黑名单",
|
||||
Code: "black",
|
||||
TimeoutJSON: nil,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
listId := createResp.IpListId
|
||||
config.Inbound.BlackListRef = &ipconfigs.IPListRef{
|
||||
IsOn: true,
|
||||
ListId: listId,
|
||||
}
|
||||
inboundJSON, err := json.Marshal(config.Inbound)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
_, err = this.RPC().HTTPFirewallPolicyRPC().UpdateHTTPFirewallInboundConfig(ctx, &pb.UpdateHTTPFirewallInboundConfigRequest{
|
||||
HttpFirewallPolicyId: policyId,
|
||||
InboundJSON: inboundJSON,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return listId, nil
|
||||
}
|
||||
|
||||
return config.Inbound.BlackListRef.ListId, nil
|
||||
}
|
||||
|
||||
// 根据服务Id查找WAF策略
|
||||
func (this *HTTPFirewallPolicyDAO) FindEnabledHTTPFirewallPolicyWithServerId(ctx context.Context, serverId int64) (*pb.HTTPFirewallPolicy, error) {
|
||||
serverResp, err := this.RPC().ServerRPC().FindEnabledServer(ctx, &pb.FindEnabledServerRequest{ServerId: serverId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
server := serverResp.Server
|
||||
if server == nil {
|
||||
return nil, nil
|
||||
}
|
||||
if server.NodeCluster == nil {
|
||||
return nil, nil
|
||||
}
|
||||
clusterId := server.NodeCluster.Id
|
||||
cluster, err := SharedNodeClusterDAO.FindEnabledNodeCluster(ctx, clusterId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if cluster == nil {
|
||||
return nil, nil
|
||||
}
|
||||
if cluster.HttpFirewallPolicyId == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
return SharedHTTPFirewallPolicyDAO.FindEnabledHTTPFirewallPolicy(ctx, cluster.HttpFirewallPolicyId)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
||||
)
|
||||
|
||||
var SharedHTTPFirewallRuleGroupDAO = new(HTTPFirewallRuleGroupDAO)
|
||||
|
||||
type HTTPFirewallRuleGroupDAO struct {
|
||||
BaseDAO
|
||||
}
|
||||
|
||||
// 查找分组配置
|
||||
func (this *HTTPFirewallRuleGroupDAO) FindRuleGroupConfig(ctx context.Context, groupId int64) (*firewallconfigs.HTTPFirewallRuleGroup, error) {
|
||||
groupResp, err := this.RPC().HTTPFirewallRuleGroupRPC().FindEnabledHTTPFirewallRuleGroupConfig(ctx, &pb.FindEnabledHTTPFirewallRuleGroupConfigRequest{FirewallRuleGroupId: groupId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(groupResp.FirewallRuleGroupJSON) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
groupConfig := &firewallconfigs.HTTPFirewallRuleGroup{}
|
||||
err = json.Unmarshal(groupResp.FirewallRuleGroupJSON, groupConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return groupConfig, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
||||
)
|
||||
|
||||
var SharedHTTPFirewallRuleSetDAO = new(HTTPFirewallRuleSetDAO)
|
||||
|
||||
type HTTPFirewallRuleSetDAO struct {
|
||||
BaseDAO
|
||||
}
|
||||
|
||||
// 查找规则集配置
|
||||
func (this *HTTPFirewallRuleSetDAO) FindRuleSetConfig(ctx context.Context, setId int64) (*firewallconfigs.HTTPFirewallRuleSet, error) {
|
||||
resp, err := this.RPC().HTTPFirewallRuleSetRPC().FindEnabledHTTPFirewallRuleSetConfig(ctx, &pb.FindEnabledHTTPFirewallRuleSetConfigRequest{FirewallRuleSetId: setId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(resp.FirewallRuleSetJSON) == 0 {
|
||||
return nil, err
|
||||
}
|
||||
config := &firewallconfigs.HTTPFirewallRuleSet{}
|
||||
err = json.Unmarshal(resp.FirewallRuleSetJSON, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
var SharedLogDAO = NewLogDAO()
|
||||
|
||||
type LogDAO struct {
|
||||
BaseDAO
|
||||
}
|
||||
|
||||
func NewLogDAO() *LogDAO {
|
||||
return &LogDAO{}
|
||||
}
|
||||
|
||||
func (this *LogDAO) CreateUserLog(ctx context.Context, level string, action string, description string, ip string) error {
|
||||
_, err := this.RPC().LogRPC().CreateLog(ctx, &pb.CreateLogRequest{
|
||||
Level: level,
|
||||
Description: description,
|
||||
Action: action,
|
||||
Ip: ip,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *LogDAO) CreateAdminLog(ctx context.Context, level string, action string, description string, ip string) error {
|
||||
_, err := this.RPC().LogRPC().CreateLog(ctx, &pb.CreateLogRequest{
|
||||
Level: level,
|
||||
Description: description,
|
||||
Action: action,
|
||||
Ip: ip,
|
||||
})
|
||||
return err
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package dao
|
||||
|
||||
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.NodeCluster, nil
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package dao
|
||||
|
||||
import "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
|
||||
var sharedRPCClient RPCClient
|
||||
|
||||
func SetRPC(client RPCClient) {
|
||||
sharedRPCClient = client
|
||||
}
|
||||
|
||||
type RPCClient interface {
|
||||
SysSettingRPC() pb.SysSettingServiceClient
|
||||
NodeClusterRPC() pb.NodeClusterServiceClient
|
||||
NodeRegionRPC() pb.NodeRegionServiceClient
|
||||
NodePriceItemRPC() pb.NodePriceItemServiceClient
|
||||
ServerRPC() pb.ServerServiceClient
|
||||
ServerGroupRPC() pb.ServerGroupServiceClient
|
||||
OriginRPC() pb.OriginServiceClient
|
||||
HTTPWebRPC() pb.HTTPWebServiceClient
|
||||
ReverseProxyRPC() pb.ReverseProxyServiceClient
|
||||
HTTPGzipRPC() pb.HTTPGzipServiceClient
|
||||
HTTPHeaderRPC() pb.HTTPHeaderServiceClient
|
||||
HTTPHeaderPolicyRPC() pb.HTTPHeaderPolicyServiceClient
|
||||
HTTPPageRPC() pb.HTTPPageServiceClient
|
||||
HTTPAccessLogPolicyRPC() pb.HTTPAccessLogPolicyServiceClient
|
||||
HTTPCachePolicyRPC() pb.HTTPCachePolicyServiceClient
|
||||
HTTPFirewallPolicyRPC() pb.HTTPFirewallPolicyServiceClient
|
||||
HTTPFirewallRuleGroupRPC() pb.HTTPFirewallRuleGroupServiceClient
|
||||
HTTPFirewallRuleSetRPC() pb.HTTPFirewallRuleSetServiceClient
|
||||
HTTPLocationRPC() pb.HTTPLocationServiceClient
|
||||
HTTPWebsocketRPC() pb.HTTPWebsocketServiceClient
|
||||
HTTPRewriteRuleRPC() pb.HTTPRewriteRuleServiceClient
|
||||
HTTPAccessLogRPC() pb.HTTPAccessLogServiceClient
|
||||
SSLCertRPC() pb.SSLCertServiceClient
|
||||
SSLPolicyRPC() pb.SSLPolicyServiceClient
|
||||
MessageRPC() pb.MessageServiceClient
|
||||
IPListRPC() pb.IPListServiceClient
|
||||
IPItemRPC() pb.IPItemServiceClient
|
||||
FileRPC() pb.FileServiceClient
|
||||
FileChunkRPC() pb.FileChunkServiceClient
|
||||
RegionCountryRPC() pb.RegionCountryServiceClient
|
||||
RegionProvinceRPC() pb.RegionProvinceServiceClient
|
||||
LogRPC() pb.LogServiceClient
|
||||
DNSDomainRPC() pb.DNSDomainServiceClient
|
||||
DNSRPC() pb.DNSServiceClient
|
||||
ACMEUserRPC() pb.ACMEUserServiceClient
|
||||
ACMETaskRPC() pb.ACMETaskServiceClient
|
||||
UserRPC() pb.UserServiceClient
|
||||
UserBillRPC() pb.UserBillServiceClient
|
||||
UserNodeRPC() pb.UserNodeServiceClient
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
)
|
||||
|
||||
var SharedServerDAO = new(ServerDAO)
|
||||
|
||||
type ServerDAO struct {
|
||||
BaseDAO
|
||||
}
|
||||
|
||||
// 查找服务配置
|
||||
func (this *ServerDAO) FindServerConfig(ctx context.Context, serverId int64) (*serverconfigs.ServerConfig, error) {
|
||||
resp, err := this.RPC().ServerRPC().FindEnabledServerConfig(ctx, &pb.FindEnabledServerConfigRequest{ServerId: serverId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(resp.ServerJSON) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
config := &serverconfigs.ServerConfig{}
|
||||
err = json.Unmarshal(resp.ServerJSON, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return config, nil
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
)
|
||||
|
||||
type SettingCode = string
|
||||
|
||||
const (
|
||||
SettingCodeServerGlobalConfig SettingCode = "serverGlobalConfig" // 服务相关全局设置
|
||||
SettingCodeNodeMonitor SettingCode = "nodeMonitor" // 监控节点状态
|
||||
SettingCodeClusterHealthCheck SettingCode = "clusterHealthCheck" // 集群健康检查
|
||||
SettingCodeIPListVersion SettingCode = "ipListVersion" // IP名单的版本号
|
||||
SettingCodeAdminSecurityConfig SettingCode = "adminSecurityConfig" // 管理员安全设置
|
||||
)
|
||||
|
||||
var SharedSysSettingDAO = new(SysSettingDAO)
|
||||
|
||||
type SysSettingDAO struct {
|
||||
BaseDAO
|
||||
}
|
||||
|
||||
// 读取服务全局配置
|
||||
func (this *SysSettingDAO) ReadGlobalConfig(ctx context.Context) (*serverconfigs.GlobalConfig, error) {
|
||||
globalConfigResp, err := this.RPC().SysSettingRPC().ReadSysSetting(ctx, &pb.ReadSysSettingRequest{Code: SettingCodeServerGlobalConfig})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(globalConfigResp.ValueJSON) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
globalConfig := &serverconfigs.GlobalConfig{}
|
||||
err = json.Unmarshal(globalConfigResp.ValueJSON, globalConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return globalConfig, nil
|
||||
}
|
||||
Reference in New Issue
Block a user