Documentation ¶
Index ¶
- Constants
- func And(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
- func FromString(policy string) (*cb.SignaturePolicyEnvelope, error)
- func NOutOf(n int32, policies []*cb.SignaturePolicy) *cb.SignaturePolicy
- func Or(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
- func SignedBy(index int32) *cb.SignaturePolicy
Constants ¶
View Source
const ( GateAnd = "And" GateOr = "Or" GateOutOf = "OutOf" )
Gate values
View Source
const ( RoleAdmin = "admin" RoleMember = "member" RoleClient = "client" RolePeer = "peer" RoleOrderer = "orderer" )
Role values for principals
Variables ¶
This section is empty.
Functions ¶
func And ¶
func And(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
And is a convenience method which utilizes NOutOf to produce And equivalent behavior
func FromString ¶
func FromString(policy string) (*cb.SignaturePolicyEnvelope, error)
FromString takes a string representation of the policy, parses it and returns a SignaturePolicyEnvelope that implements that policy. The supported language is as follows:
GATE(P[, P])
where:
- GATE is either "and" or "or"
- P is either a principal or another nested call to GATE
A principal is defined as:
ORG.ROLE ¶
where:
- ORG is a string (representing the MSP identifier)
- ROLE takes the value of any of the RoleXXX constants representing the required role
func NOutOf ¶
func NOutOf(n int32, policies []*cb.SignaturePolicy) *cb.SignaturePolicy
NOutOf creates a policy which requires N out of the slice of policies to evaluate to true
func Or ¶
func Or(lhs, rhs *cb.SignaturePolicy) *cb.SignaturePolicy
Or is a convenience method which utilizes NOutOf to produce Or equivalent behavior
func SignedBy ¶
func SignedBy(index int32) *cb.SignaturePolicy
SignedBy creates a SignaturePolicy requiring a given signer's signature
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.