{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package policies\n\n## Constants\n\n```go\nconst (\n\t// Path separator is used to separate policy names in paths\n\tPathSeparator = \"/\"\n\n\t// ChannelPrefix is used in the path of standard channel policy managers\n\tChannelPrefix = \"Channel\"\n\n\t// ApplicationPrefix is used in the path of standard application policy paths\n\tApplicationPrefix = \"Application\"\n\n\t// OrdererPrefix is used in the path of standard orderer policy paths\n\tOrdererPrefix = \"Orderer\"\n\n\t// ChannelReaders is the label for the channel's readers policy (encompassing both orderer and application readers)\n\tChannelReaders = PathSeparator + ChannelPrefix + PathSeparator + \"Readers\"\n\n\t// ChannelWriters is the label for the channel's writers policy (encompassing both orderer and application writers)\n\tChannelWriters = PathSeparator + ChannelPrefix + PathSeparator + \"Writers\"\n\n\t// ChannelApplicationReaders is the label for the channel's application readers policy\n\tChannelApplicationReaders = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + \"Readers\"\n\n\t// ChannelApplicationWriters is the label for the channel's application writers policy\n\tChannelApplicationWriters = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + \"Writers\"\n\n\t// ChannelApplicationAdmins is the label for the channel's application admin policy\n\tChannelApplicationAdmins = PathSeparator + ChannelPrefix + PathSeparator + ApplicationPrefix + PathSeparator + \"Admins\"\n\n\t// BlockValidation is the label for the policy which should validate the block signatures for the channel\n\tBlockValidation = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + \"BlockValidation\"\n\n\t// ChannelOrdererAdmins is the label for the channel's orderer admin policy\n\tChannelOrdererAdmins = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + \"Admins\"\n\n\t// ChannelOrdererWriters is the label for the channel's orderer writers policy\n\tChannelOrdererWriters = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + \"Writers\"\n\n\t// ChannelOrdererReaders is the label for the channel's orderer readers policy\n\tChannelOrdererReaders = PathSeparator + ChannelPrefix + PathSeparator + OrdererPrefix + PathSeparator + \"Readers\"\n)\n```\n\n## Functions\n\n```go\nfunc ImplicitMetaFromString(input string) (*cb.ImplicitMetaPolicy, error)\n```\n\n```go\nfunc ImplicitMetaPolicyWithSubPolicy(subPolicyName string, rule cb.ImplicitMetaPolicy_Rule) *cb.ConfigPolicy\n```\nImplicitMetaPolicyWithSubPolicy creates an implicitmeta policy\n\n```go\nfunc TemplateImplicitMetaAllPolicy(path []string, policyName string) *cb.ConfigGroup\n```\nTempateImplicitMetaAnyPolicy returns TemplateImplicitMetaPolicy with cb.ImplicitMetaPolicy\\_ALL as the rule\n\n```go\nfunc TemplateImplicitMetaAnyPolicy(path []string, policyName string) *cb.ConfigGroup\n```\nTempateImplicitMetaAnyPolicy returns TemplateImplicitMetaPolicy with cb.ImplicitMetaPolicy\\_ANY as the rule\n\n```go\nfunc TemplateImplicitMetaMajorityPolicy(path []string, policyName string) *cb.ConfigGroup\n```\nTempateImplicitMetaAnyPolicy returns TemplateImplicitMetaPolicy with cb.ImplicitMetaPolicy\\_MAJORITY as the rule\n\n```go\nfunc TemplateImplicitMetaPolicy(path []string, policyName string, rule cb.ImplicitMetaPolicy_Rule) *cb.ConfigGroup\n```\nTemplateImplicitMetaPolicy creates a policy at the specified path with the given policyName It utilizes the policyName for the subPolicyName as well, as this is the standard usage pattern\n\n```go\nfunc TemplateImplicitMetaPolicyWithSubPolicy(path []string, policyName string, subPolicyName string, rule cb.ImplicitMetaPolicy_Rule) *cb.ConfigGroup\n```\nTemplateImplicitMetaPolicy creates a policy at the specified path with the given policyName and subPolicyName\n\n## Types\n\n```go\ntype ChannelPolicyManagerGetter interface {\n\t// Returns the policy manager associated to the passed channel\n\t// and true if it was the manager requested, or false if it is the default manager\n\tManager(channelID string) (Manager, bool)\n}\n```\nChannelPolicyManagerGetter is a support interface to get access to the policy manager of a given channel\n\n```go\ntype ConfigPolicy interface {\n\t// Key is the key this value should be stored in the *cb.ConfigGroup.Policies map.\n\tKey() string\n\n\t// Value is the backing policy implementation for this ConfigPolicy\n\tValue() *cb.Policy\n}\n```\nConfigPolicy defines a common representation for different \\*cb.ConfigPolicy values.\n\n```go\ntype InquireablePolicy interface {\n\t// SatisfiedBy returns a slice of PrincipalSets that each of them\n\t// satisfies the policy.\n\tSatisfiedBy() []PrincipalSet\n}\n```\nInquireablePolicy is a Policy that one can inquire\n\n```go\ntype Manager interface {\n\t// GetPolicy returns a policy and true if it was the policy requested, or false if it is the default policy\n\tGetPolicy(id string) (Policy, bool)\n\n\t// Manager returns the sub-policy manager for a given path and whether it exists\n\tManager(path []string) (Manager, bool)\n}\n```\nManager is a read only subset of the policy ManagerImpl\n\n```go\ntype ManagerImpl struct {\n\t// contains filtered or unexported fields\n}\n```\nManagerImpl is an implementation of Manager and configtx.ConfigHandler In general, it should only be referenced as an Impl for the configtx.ConfigManager\n\n```go\nfunc NewManagerImpl(path string, providers map[int32]Provider, root *cb.ConfigGroup) (*ManagerImpl, error)\n```\nNewManagerImpl creates a new ManagerImpl with the given CryptoHelper\n\n```go\nfunc (pm *ManagerImpl) GetPolicy(id string) (Policy, bool)\n```\nGetPolicy returns a policy and true if it was the policy requested, or false if it is the default reject policy\n\n```go\nfunc (pm *ManagerImpl) Manager(path []string) (Manager, bool)\n```\nManager returns the sub-policy manager for a given path and whether it exists\n\n```go\ntype Policy interface {\n\t// Evaluate takes a set of SignedData and evaluates whether this set of signatures satisfies the policy\n\tEvaluate(signatureSet []*cb.SignedData) error\n}\n```\nPolicy is used to determine if a signature is valid\n\n```go\ntype PrincipalSet []*msp.MSPPrincipal\n```\nPrincipalSet is a collection of MSPPrincipals\n\n```go\nfunc (ps PrincipalSet) ContainingOnly(f func(*msp.MSPPrincipal) bool) bool\n```\nContainingOnly returns whether the given PrincipalSet contains only Principals that satisfy the given predicate\n\n```go\nfunc (ps PrincipalSet) UniqueSet() map[*msp.MSPPrincipal]int\n```\nUniqueSet returns a histogram that is induced by the PrincipalSet\n\n```go\ntype PrincipalSets []PrincipalSet\n```\nPrincipalSets aggregates PrincipalSets\n\n```go\nfunc (psSets PrincipalSets) ContainingOnly(f func(*msp.MSPPrincipal) bool) PrincipalSets\n```\nContainingOnly returns PrincipalSets that contain only principals of the given predicate\n\n```go\ntype Provider interface {\n\t// NewPolicy creates a new policy based on the policy bytes\n\tNewPolicy(data []byte) (Policy, proto.Message, error)\n}\n```\nProvider provides the backing implementation of a policy\n\n```go\ntype StandardConfigPolicy struct {\n\t// contains filtered or unexported fields\n}\n```\nStandardConfigValue implements the ConfigValue interface.\n\n```go\nfunc ImplicitMetaAllPolicy(policyName string) *StandardConfigPolicy\n```\nImplicitMetaAllPolicy defines an implicit meta policy whose sub\\_policy and key is policyname with rule ALL.\n\n```go\nfunc ImplicitMetaAnyPolicy(policyName string) *StandardConfigPolicy\n```\nImplicitMetaAnyPolicy defines an implicit meta policy whose sub\\_policy and key is policyname with rule ANY.\n\n```go\nfunc ImplicitMetaMajorityPolicy(policyName string) *StandardConfigPolicy\n```\nImplicitMetaMajorityPolicy defines an implicit meta policy whose sub\\_policy and key is policyname with rule MAJORITY.\n\n```go\nfunc SignaturePolicy(policyName string, sigPolicy *cb.SignaturePolicyEnvelope) *StandardConfigPolicy\n```\nImplicitMetaMajorityPolicy defines a policy with key policyName and the given signature policy.\n\n```go\nfunc (scv *StandardConfigPolicy) Key() string\n```\nKey is the key this value should be stored in the \\*cb.ConfigGroup.Values map.\n\n```go\nfunc (scv *StandardConfigPolicy) Value() *cb.Policy\n```\nValue is the \\*cb.Policy which should be stored as the \\*cb.ConfigPolicy.Policy.\n\n","path":"github.com/eric-erki/https-hyperledger.org/common/policies","name":"policies","synopsis":"","isRedistributable":true}
