1 Star 0 Fork 0

陈文甲/fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
peerpolicies.go 736 Bytes
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. 2017 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package resourcesconfig
import (
cb "github.com/hyperledger/fabric/protos/common"
"github.com/pkg/errors"
)
// peerPoliciesGroup is a free-form group, which supports only policies
type peerPoliciesGroup struct{}
func newPeerPoliciesGroup(group *cb.ConfigGroup) (*peerPoliciesGroup, error) {
return &peerPoliciesGroup{}, verifyNoMoreValues(group)
}
func verifyNoMoreValues(subGroup *cb.ConfigGroup) error {
if len(subGroup.Values) > 0 {
return errors.Errorf("sub-groups not allowed to have values")
}
for _, subGroup := range subGroup.Groups {
if err := verifyNoMoreValues(subGroup); err != nil {
return err
}
}
return nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/venjia/fabric.git
git@gitee.com:venjia/fabric.git
venjia
fabric
fabric
v1.1.0-preview

搜索帮助

0d507c66 1850385 C8b1a773 1850385