63 Star 183 Fork 3

Gitee 极速下载/hyperledger-fabric

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hyperledger/fabric
克隆/下载
interfaces.go 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package statebased
import "fmt"
// RoleType of an endorsement policy's identity
type RoleType string
const (
// RoleTypeMember identifies an org's member identity
RoleTypeMember = RoleType("MEMBER")
// RoleTypePeer identifies an org's peer identity
RoleTypePeer = RoleType("PEER")
)
// RoleTypeDoesNotExistError is returned by function AddOrgs of
// KeyEndorsementPolicy if a role type that does not match one
// specified above is passed as an argument.
type RoleTypeDoesNotExistError struct {
RoleType RoleType
}
func (r *RoleTypeDoesNotExistError) Error() string {
return fmt.Sprintf("role type %s does not exist", r.RoleType)
}
// KeyEndorsementPolicy provides a set of convenience methods to create and
// modify a state-based endorsement policy. Endorsement policies created by
// this convenience layer will always be a logical AND of "<ORG>.peer"
// principals for one or more ORGs specified by the caller.
type KeyEndorsementPolicy interface {
// Policy returns the endorsement policy as bytes
Policy() ([]byte, error)
// AddOrgs adds the specified orgs to the list of orgs that are required
// to endorse. All orgs MSP role types will be set to the role that is
// specified in the first parameter. Among other aspects the desired role
// depends on the channel's configuration: if it supports node OUs, it is
// likely going to be the PEER role, while the MEMBER role is the suited
// one if it does not.
AddOrgs(roleType RoleType, organizations ...string) error
// DelOrgs deletes the specified channel orgs from the existing key-level endorsement
// policy for this KVS key.
DelOrgs(organizations ...string)
// ListOrgs returns an array of channel orgs that are required to endorse chnages
ListOrgs() []string
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mirrors/hyperledger-fabric.git
git@gitee.com:mirrors/hyperledger-fabric.git
mirrors
hyperledger-fabric
hyperledger-fabric
v1.4.0-rc1

搜索帮助