{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package policy\n\n## Functions\n\n```go\nfunc RegisterPolicyCheckerFactory(f PolicyCheckerFactory)\n```\nRegisterPolicyCheckerFactory is to be called once to set the factory that will be used to obtain instances of PolicyChecker\n\n## Types\n\n```go\ntype PolicyChecker interface {\n\t// CheckPolicy checks that the passed signed proposal is valid with the respect to\n\t// passed policy on the passed channel.\n\t// If no channel is passed, CheckPolicyNoChannel is invoked directly.\n\tCheckPolicy(channelID, policyName string, signedProp *pb.SignedProposal) error\n\n\t// CheckPolicyBySignedData checks that the passed signed data is valid with the respect to\n\t// passed policy on the passed channel.\n\t// If no channel is passed, the method will fail.\n\tCheckPolicyBySignedData(channelID, policyName string, sd []*common.SignedData) error\n\n\t// CheckPolicyNoChannel checks that the passed signed proposal is valid with the respect to\n\t// passed policy on the local MSP.\n\tCheckPolicyNoChannel(policyName string, signedProp *pb.SignedProposal) error\n}\n```\nPolicyChecker offers methods to check a signed proposal against a specific policy defined in a channel or not.\n\n```go\nfunc GetPolicyChecker() PolicyChecker\n```\nGetPolicyChecker returns instances of PolicyChecker; the actual implementation is controlled by the factory that is registered via RegisterPolicyCheckerFactory\n\n```go\nfunc NewPolicyChecker(channelPolicyManagerGetter policies.ChannelPolicyManagerGetter, localMSP msp.IdentityDeserializer, principalGetter mgmt.MSPPrincipalGetter) PolicyChecker\n```\nNewPolicyChecker creates a new instance of PolicyChecker\n\n```go\ntype PolicyCheckerFactory interface {\n\tNewPolicyChecker() PolicyChecker\n}\n```\nPolicyCheckerFactory defines a factory interface so that the actual implementation can be injected\n\n","path":"github.com/eric-erki/https-hyperledger.org/core/policy","name":"policy","synopsis":"","isRedistributable":true}
