policies

package
v1.0.0-preview Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2017 License: Apache-2.0 Imports: 4 Imported by: 8,372

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// GetPolicy returns a policy and true if it was the policy requested, or false if it is the default policy
	GetPolicy(id string) (Policy, bool)
}

Manager is intended to be the primary accessor of ManagerImpl It is intended to discourage use of the other exported ManagerImpl methods which are used for updating policy by the ConfigManager

type ManagerImpl

type ManagerImpl struct {
	// contains filtered or unexported fields
}

ManagerImpl is an implementation of Manager and configtx.ConfigHandler In general, it should only be referenced as an Impl for the configtx.ConfigManager

func NewManagerImpl

func NewManagerImpl(providers map[int32]Provider) *ManagerImpl

NewManagerImpl creates a new ManagerImpl with the given CryptoHelper

func (*ManagerImpl) BeginConfig

func (pm *ManagerImpl) BeginConfig()

BeginConfig is used to start a new configuration proposal

func (*ManagerImpl) CommitConfig

func (pm *ManagerImpl) CommitConfig()

CommitConfig is used to commit a new configuration proposal

func (*ManagerImpl) GetPolicy

func (pm *ManagerImpl) GetPolicy(id string) (Policy, bool)

GetPolicy returns a policy and true if it was the policy requested, or false if it is the default reject policy

func (*ManagerImpl) ProposeConfig

func (pm *ManagerImpl) ProposeConfig(configItem *cb.ConfigurationItem) error

ProposeConfig is used to add new configuration to the configuration proposal

func (*ManagerImpl) RollbackConfig

func (pm *ManagerImpl) RollbackConfig()

RollbackConfig is used to abandon a new configuration proposal

type Policy

type Policy interface {
	// Evaluate takes a set of SignedData and evaluates whether this set of signatures satisfies the policy
	Evaluate(signatureSet []*cb.SignedData) error
}

Policy is used to determine if a signature is valid

type Provider

type Provider interface {
	// NewPolicy creates a new policy based on the policy bytes
	NewPolicy(data []byte) (Policy, error)
}

Provider provides the backing implementation of a policy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL