config

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Note, the directory is still configvalues, but this is stuttery and config is a more accurate and better name, TODO, update directory

Index

Constants

View Source
const (
	// HashingAlgorithmKey is the cb.ConfigItem type key name for the HashingAlgorithm message
	HashingAlgorithmKey = "HashingAlgorithm"

	// BlockDataHashingStructureKey is the cb.ConfigItem type key name for the BlockDataHashingStructure message
	BlockDataHashingStructureKey = "BlockDataHashingStructure"

	// OrdererAddressesKey is the cb.ConfigItem type key name for the OrdererAddresses message
	OrdererAddressesKey = "OrdererAddresses"

	// GroupKey is the name of the channel group
	ChannelGroupKey = "Channel"
)

Channel config keys

View Source
const (
	// ConsensusTypeKey is the cb.ConfigItem type key name for the ConsensusType message
	ConsensusTypeKey = "ConsensusType"

	// BatchSizeKey is the cb.ConfigItem type key name for the BatchSize message
	BatchSizeKey = "BatchSize"

	// BatchTimeoutKey is the cb.ConfigItem type key name for the BatchTimeout message
	BatchTimeoutKey = "BatchTimeout"

	// ChainCreationPolicyNamesKey is the cb.ConfigItem type key name for the ChainCreationPolicyNames message
	ChainCreationPolicyNamesKey = "ChainCreationPolicyNames"

	// ChannelRestrictions is the key name for the ChannelRestrictions message
	ChannelRestrictionsKey = "ChannelRestrictions"

	// KafkaBrokersKey is the cb.ConfigItem type key name for the KafkaBrokers message
	KafkaBrokersKey = "KafkaBrokers"
)
View Source
const (
	// AnchorPeersKey is the key name for the AnchorPeers ConfigValue
	AnchorPeersKey = "AnchorPeers"
)

Application org config keys

View Source
const (
	// ApplicationGroupKey is the group name for the Application config
	ApplicationGroupKey = "Application"
)
View Source
const (
	// MSPKey is value key for marshaled *mspconfig.MSPConfig
	MSPKey = "MSP"
)

Org config keys

View Source
const (
	// OrdererGroupKey is the group name for the orderer config
	OrdererGroupKey = "Orderer"
)

Variables

This section is empty.

Functions

func DefaultBlockDataHashingStructure added in v1.0.0

func DefaultBlockDataHashingStructure() *cb.ConfigGroup

DefaultBlockDatahashingStructure creates a headerless config item for the default block data hashing structure

func DefaultHashingAlgorithm added in v1.0.0

func DefaultHashingAlgorithm() *cb.ConfigGroup

DefaultHashingAlgorithm creates a headerless config item for the default hashing algorithm

func DefaultOrdererAddresses added in v1.0.0

func DefaultOrdererAddresses() *cb.ConfigGroup

DefaultOrdererAddresses creates a headerless config item for the default orderer addresses

func NewStandardValues added in v1.0.0

func NewStandardValues(protosStructs ...interface{}) (*standardValues, error)

NewStandardValues accepts a structure which must contain only protobuf message types. The structure may embed other (non-pointer) structures which satisfy the same condition. NewStandard values will instantiate memory for all the proto messages and build a lookup map from structure field name to proto message instance This is a useful way to easily implement the Values interface

func TemplateAnchorPeers added in v1.0.0

func TemplateAnchorPeers(orgID string, anchorPeers []*pb.AnchorPeer) *cb.ConfigGroup

TemplateAnchorPeers creates a headerless config item representing the anchor peers

func TemplateBatchSize added in v1.0.0

func TemplateBatchSize(batchSize *ab.BatchSize) *cb.ConfigGroup

TemplateBatchSize creates a headerless config item representing the batch size

func TemplateBatchTimeout added in v1.0.0

func TemplateBatchTimeout(batchTimeout string) *cb.ConfigGroup

TemplateBatchTimeout creates a headerless config item representing the batch timeout

func TemplateBlockDataHashingStructure added in v1.0.0

func TemplateBlockDataHashingStructure(width uint32) *cb.ConfigGroup

TemplateBlockDataHashingStructure creates a headerless config item representing the block data hashing structure

func TemplateChainCreationPolicyNames

func TemplateChainCreationPolicyNames(names []string) *cb.ConfigGroup

TemplateChainCreationPolicyNames creates a headerless configuraiton item representing the chain creation policy names

func TemplateChannelRestrictions added in v1.0.0

func TemplateChannelRestrictions(maxChannels uint64) *cb.ConfigGroup

TemplateChannelRestrictions creates a config group with ChannelRestrictions specified

func TemplateConsensusType added in v1.0.0

func TemplateConsensusType(typeValue string) *cb.ConfigGroup

TemplateConsensusType creates a headerless config item representing the consensus type

func TemplateHashingAlgorithm added in v1.0.0

func TemplateHashingAlgorithm(name string) *cb.ConfigGroup

TemplateHashingAlgorithm creates a ConfigGroup representing the HashingAlgorithm

func TemplateKafkaBrokers added in v1.0.0

func TemplateKafkaBrokers(brokers []string) *cb.ConfigGroup

TemplateKafkaBrokers creates a headerless config item representing the kafka brokers

func TemplateOrdererAddresses added in v1.0.0

func TemplateOrdererAddresses(addresses []string) *cb.ConfigGroup

TemplateOrdererAddressess creates a headerless config item representing the orderer addresses

Types

type Application added in v1.0.0

type Application interface {
	// Organizations returns a map of org ID to ApplicationOrg
	Organizations() map[string]ApplicationOrg
}

Application stores the common shared application config

type ApplicationConfig added in v1.0.0

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

func NewApplicationConfig added in v1.0.0

func NewApplicationConfig(ag *ApplicationGroup) *ApplicationConfig

func (*ApplicationConfig) Commit added in v1.0.0

func (ac *ApplicationConfig) Commit()

func (ApplicationConfig) Deserialize added in v1.0.0

func (sv ApplicationConfig) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*ApplicationConfig) Organizations added in v1.0.0

func (ac *ApplicationConfig) Organizations() map[string]ApplicationOrg

Organizations returns a map of org ID to ApplicationOrg

func (*ApplicationConfig) Validate added in v1.0.0

func (ac *ApplicationConfig) Validate(tx interface{}, groups map[string]ValueProposer) error

type ApplicationGroup added in v1.0.0

type ApplicationGroup struct {
	*Proposer
	*ApplicationConfig
	// contains filtered or unexported fields
}

ApplicationGroup represents the application config group

func NewApplicationGroup added in v1.0.0

func NewApplicationGroup(mspConfig *msp.MSPConfigHandler) *ApplicationGroup

NewSharedConfigImpl creates a new SharedConfigImpl with the given CryptoHelper

func (*ApplicationGroup) Allocate added in v1.0.0

func (ag *ApplicationGroup) Allocate() Values

Allocate returns a new instance of the ApplicationConfig

func (ApplicationGroup) Deserialize added in v1.0.0

func (sv ApplicationGroup) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*ApplicationGroup) NewGroup added in v1.0.0

func (ag *ApplicationGroup) NewGroup(name string) (ValueProposer, error)

type ApplicationOrg added in v1.0.0

type ApplicationOrg interface {
	Org

	// AnchorPeers returns the list of gossip anchor peers
	AnchorPeers() []*pb.AnchorPeer
}

ApplicationOrg stores the per org application config

type ApplicationOrgConfig added in v1.0.0

type ApplicationOrgConfig struct {
	*OrganizationConfig
	// contains filtered or unexported fields
}

func NewApplicationOrgConfig added in v1.0.0

func NewApplicationOrgConfig(aog *ApplicationOrgGroup) *ApplicationOrgConfig

func (*ApplicationOrgConfig) AnchorPeers added in v1.0.0

func (aog *ApplicationOrgConfig) AnchorPeers() []*pb.AnchorPeer

AnchorPeers returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver

func (*ApplicationOrgConfig) Commit added in v1.0.0

func (aoc *ApplicationOrgConfig) Commit()

func (ApplicationOrgConfig) Deserialize added in v1.0.0

func (sv ApplicationOrgConfig) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*ApplicationOrgConfig) Validate added in v1.0.0

func (aoc *ApplicationOrgConfig) Validate(tx interface{}, groups map[string]ValueProposer) error

type ApplicationOrgGroup added in v1.0.0

type ApplicationOrgGroup struct {
	*Proposer
	*OrganizationGroup
	*ApplicationOrgConfig
}

ApplicationOrgGroup defines the configuration for an application org

func NewApplicationOrgGroup added in v1.0.0

func NewApplicationOrgGroup(id string, mspConfig *mspconfig.MSPConfigHandler) *ApplicationOrgGroup

NewApplicationOrgGroup creates a new ApplicationOrgGroup

func (*ApplicationOrgGroup) Allocate added in v1.0.0

func (aog *ApplicationOrgGroup) Allocate() Values

type ApplicationOrgProtos added in v1.0.0

type ApplicationOrgProtos struct {
	AnchorPeers *pb.AnchorPeers
}

type Channel added in v1.0.0

type Channel interface {
	// HashingAlgorithm returns the default algorithm to be used when hashing
	// such as computing block hashes, and CreationPolicy digests
	HashingAlgorithm() func(input []byte) []byte

	// BlockDataHashingStructureWidth returns the width to use when constructing the
	// Merkle tree to compute the BlockData hash
	BlockDataHashingStructureWidth() uint32

	// OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver
	OrdererAddresses() []string
}

Channel gives read only access to the channel configuration

type ChannelConfig added in v1.0.0

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

ChannelConfig stores the channel configuration

func NewChannelConfig added in v1.0.0

func NewChannelConfig() *ChannelConfig

NewChannelConfig creates a new ChannelConfig

func (*ChannelConfig) BlockDataHashingStructureWidth added in v1.0.0

func (cc *ChannelConfig) BlockDataHashingStructureWidth() uint32

BlockDataHashingStructure returns the width to use when forming the block data hashing structure

func (ChannelConfig) Deserialize added in v1.0.0

func (sv ChannelConfig) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*ChannelConfig) HashingAlgorithm added in v1.0.0

func (cc *ChannelConfig) HashingAlgorithm() func(input []byte) []byte

HashingAlgorithm returns a function pointer to the chain hashing algorihtm

func (*ChannelConfig) OrdererAddresses added in v1.0.0

func (cc *ChannelConfig) OrdererAddresses() []string

OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver

func (*ChannelConfig) Validate added in v1.0.0

func (cc *ChannelConfig) Validate(tx interface{}, groups map[string]ValueProposer) error

Validate inspects the generated configuration protos, ensures that the values are correct, and sets the ChannelConfig fields that may be referenced after Commit

type ChannelGroup added in v1.0.0

type ChannelGroup struct {
	*ChannelConfig
	*Proposer
	// contains filtered or unexported fields
}

ChannelGroup

func NewChannelGroup added in v1.0.0

func NewChannelGroup(mspConfigHandler *msp.MSPConfigHandler) *ChannelGroup

func (*ChannelGroup) Allocate added in v1.0.0

func (cg *ChannelGroup) Allocate() Values

Allocate creates new config resources for a pending config update

func (*ChannelGroup) ApplicationConfig added in v1.0.0

func (cg *ChannelGroup) ApplicationConfig() *ApplicationGroup

ApplicationConfig returns the application config associated with this channel

func (ChannelGroup) Deserialize added in v1.0.0

func (sv ChannelGroup) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*ChannelGroup) NewGroup added in v1.0.0

func (cg *ChannelGroup) NewGroup(group string) (ValueProposer, error)

NewGroup instantiates either a new application or orderer config

func (*ChannelGroup) OrdererConfig added in v1.0.0

func (cg *ChannelGroup) OrdererConfig() *OrdererGroup

OrdererConfig returns the orderer config associated with this channel

type ChannelProtos added in v1.0.0

type ChannelProtos struct {
	HashingAlgorithm          *cb.HashingAlgorithm
	BlockDataHashingStructure *cb.BlockDataHashingStructure
	OrdererAddresses          *cb.OrdererAddresses
}

ChannelProtos is where the proposed configuration is unmarshaled into

type ChannelValues added in v1.0.0

type ChannelValues interface {
	// HashingAlgorithm returns the default algorithm to be used when hashing
	// such as computing block hashes, and CreationPolicy digests
	HashingAlgorithm() func(input []byte) []byte

	// BlockDataHashingStructureWidth returns the width to use when constructing the
	// Merkle tree to compute the BlockData hash
	BlockDataHashingStructureWidth() uint32

	// OrdererAddresses returns the list of valid orderer addresses to connect to to invoke Broadcast/Deliver
	OrdererAddresses() []string
}

ChannelValues gives read only access to the channel configuration

type Handler added in v1.0.0

type Handler interface {
	Allocate() Values
	NewGroup(name string) (ValueProposer, error)
}

Handler

type Orderer added in v1.0.0

type Orderer interface {
	// ConsensusType returns the configured consensus type
	ConsensusType() string

	// BatchSize returns the maximum number of messages to include in a block
	BatchSize() *ab.BatchSize

	// BatchTimeout returns the amount of time to wait before creating a batch
	BatchTimeout() time.Duration

	// ChainCreationPolicyNames returns the policy names which are allowed for chain creation
	// This field is only set for the system ordering chain
	ChainCreationPolicyNames() []string

	// MaxChannelsCount returns the maximum count of channels to allow for an ordering network
	MaxChannelsCount() uint64

	// KafkaBrokers returns the addresses (IP:port notation) of a set of "bootstrap"
	// Kafka brokers, i.e. this is not necessarily the entire set of Kafka brokers
	// used for ordering
	KafkaBrokers() []string
}

Orderer stores the common shared orderer config

type OrdererConfig added in v1.0.0

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

OrdererConfig holds the orderer configuration information

func NewOrdererConfig added in v1.0.0

func NewOrdererConfig(og *OrdererGroup) *OrdererConfig

NewOrdererConfig creates a new instance of the orderer config

func (*OrdererConfig) BatchSize added in v1.0.0

func (oc *OrdererConfig) BatchSize() *ab.BatchSize

BatchSize returns the maximum number of messages to include in a block

func (*OrdererConfig) BatchTimeout added in v1.0.0

func (oc *OrdererConfig) BatchTimeout() time.Duration

BatchTimeout returns the amount of time to wait before creating a batch

func (*OrdererConfig) ChainCreationPolicyNames

func (oc *OrdererConfig) ChainCreationPolicyNames() []string

ChainCreationPolicyNames returns the policy names which are allowed for chain creation This field is only set for the system ordering chain

func (*OrdererConfig) Commit added in v1.0.0

func (oc *OrdererConfig) Commit()

Commit writes the orderer config back to the orderer config group

func (*OrdererConfig) ConsensusType added in v1.0.0

func (oc *OrdererConfig) ConsensusType() string

ConsensusType returns the configured consensus type

func (OrdererConfig) Deserialize added in v1.0.0

func (sv OrdererConfig) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*OrdererConfig) KafkaBrokers added in v1.0.0

func (oc *OrdererConfig) KafkaBrokers() []string

KafkaBrokers returns the addresses (IP:port notation) of a set of "bootstrap" Kafka brokers, i.e. this is not necessarily the entire set of Kafka brokers used for ordering

func (*OrdererConfig) MaxChannelsCount added in v1.0.0

func (oc *OrdererConfig) MaxChannelsCount() uint64

MaxChannelsCount returns the maximum count of channels this orderer supports

func (*OrdererConfig) Validate added in v1.0.0

func (oc *OrdererConfig) Validate(tx interface{}, groups map[string]ValueProposer) error

type OrdererGroup added in v1.0.0

type OrdererGroup struct {
	*Proposer
	*OrdererConfig
	// contains filtered or unexported fields
}

Config is stores the orderer component configuration

func NewOrdererGroup added in v1.0.0

func NewOrdererGroup(mspConfig *msp.MSPConfigHandler) *OrdererGroup

NewConfig creates a new *OrdererConfig

func (*OrdererGroup) Allocate added in v1.0.0

func (og *OrdererGroup) Allocate() Values

func (OrdererGroup) Deserialize added in v1.0.0

func (sv OrdererGroup) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*OrdererGroup) NewGroup added in v1.0.0

func (og *OrdererGroup) NewGroup(name string) (ValueProposer, error)

NewGroup returns an Org instance

type OrdererProtos added in v1.0.0

type OrdererProtos struct {
	ConsensusType            *ab.ConsensusType
	BatchSize                *ab.BatchSize
	BatchTimeout             *ab.BatchTimeout
	ChainCreationPolicyNames *ab.ChainCreationPolicyNames
	KafkaBrokers             *ab.KafkaBrokers
	CreationPolicy           *ab.CreationPolicy
	ChannelRestrictions      *ab.ChannelRestrictions
}

OrdererProtos is used as the source of the OrdererConfig

type Org added in v1.0.0

type Org interface {
	// Name returns the name this org is referred to in config
	Name() string

	// MSPID returns the MSP ID associated with this org
	MSPID() string
}

Org stores the common organizational config

type OrganizationConfig added in v1.0.0

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

func NewOrganizationConfig added in v1.0.0

func NewOrganizationConfig(og *OrganizationGroup) *OrganizationConfig

func (*OrganizationConfig) Commit added in v1.0.0

func (oc *OrganizationConfig) Commit()

func (OrganizationConfig) Deserialize added in v1.0.0

func (sv OrganizationConfig) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*OrganizationConfig) Validate added in v1.0.0

func (oc *OrganizationConfig) Validate(tx interface{}, groups map[string]ValueProposer) error

Validate returns whether the configuration is valid

type OrganizationGroup added in v1.0.0

type OrganizationGroup struct {
	*Proposer
	*OrganizationConfig
	// contains filtered or unexported fields
}

Config stores common configuration information for organizations

func NewOrganizationGroup added in v1.0.0

func NewOrganizationGroup(name string, mspConfigHandler *mspconfig.MSPConfigHandler) *OrganizationGroup

NewConfig creates an instnace of the organization Config

func (*OrganizationGroup) Allocate added in v1.0.0

func (og *OrganizationGroup) Allocate() Values

Allocate creates the proto resources neeeded for a proposal

func (OrganizationGroup) Deserialize added in v1.0.0

func (sv OrganizationGroup) Deserialize(key string, value []byte) (proto.Message, error)

Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes to populate the backing message structure, and retuns a referenced to the retained deserialized message (or an error, either because the key did not exist, or there was an an error unmarshaling

func (*OrganizationGroup) MSPID added in v1.0.0

func (og *OrganizationGroup) MSPID() string

MSPID returns the MSP ID associated with this org

func (*OrganizationGroup) Name added in v1.0.0

func (og *OrganizationGroup) Name() string

Name returns the name this org is referred to in config

func (*OrganizationGroup) NewGroup added in v1.0.0

func (og *OrganizationGroup) NewGroup(name string) (ValueProposer, error)

NewGroup always errors

type OrganizationProtos added in v1.0.0

type OrganizationProtos struct {
	MSP *mspprotos.MSPConfig
}

type Proposer added in v1.0.0

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

func NewProposer added in v1.0.0

func NewProposer(vh Handler) *Proposer

func (*Proposer) BeginValueProposals added in v1.0.0

func (p *Proposer) BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)

BeginValueProposals called when a config proposal is begun

func (*Proposer) CommitProposals added in v1.0.0

func (p *Proposer) CommitProposals(tx interface{})

CommitProposals called when a config proposal is committed

func (*Proposer) PreCommit added in v1.0.0

func (p *Proposer) PreCommit(tx interface{}) error

Validate ensures that the new config values is a valid change

func (*Proposer) RollbackProposals added in v1.0.0

func (p *Proposer) RollbackProposals(tx interface{})

RollbackProposals called when a config proposal is abandoned

type Root added in v1.0.0

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

Root acts as the object which anchors the rest of the config Note, yes, this is a stuttering name, but, the intent is to move this up one level at the end of refactoring

func NewRoot added in v1.0.0

func NewRoot(mspConfigHandler *msp.MSPConfigHandler) *Root

NewRoot creates a new instance of the Root

func (*Root) Application added in v1.0.0

func (r *Root) Application() *ApplicationGroup

Application returns the associated Application level config

func (*Root) BeginValueProposals added in v1.0.0

func (r *Root) BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)

BeginValueProposals is used to start a new config proposal

func (*Root) Channel added in v1.0.0

func (r *Root) Channel() *ChannelGroup

Channel returns the associated Channel level config

func (*Root) CommitProposals added in v1.0.0

func (r *Root) CommitProposals(tx interface{})

CommitConfig is used to commit a new config proposal

func (*Root) Orderer added in v1.0.0

func (r *Root) Orderer() *OrdererGroup

Orderer returns the associated Orderer level config

func (*Root) PreCommit added in v1.0.0

func (r *Root) PreCommit(tx interface{}) error

PreCommit is used to verify total configuration before commit

func (*Root) RollbackProposals added in v1.0.0

func (r *Root) RollbackProposals(tx interface{})

RollbackConfig is used to abandon a new config proposal

type ValueDeserializer added in v1.0.0

type ValueDeserializer interface {
	// Deserialize takes a Value key as a string, and a marshaled Value value as bytes
	// and returns the deserialized version of that value.  Note, this function operates
	// with side effects intended.  Using a ValueDeserializer to deserialize a message will
	// generally set the value in the Values interface that the ValueDeserializer derived from
	// Therefore, the proto.Message may be safely discarded, but may be retained for
	// inspection and or debugging purposes.
	Deserialize(key string, value []byte) (proto.Message, error)
}

ValueDeserializer provides a mechanism to retrieve proto messages to deserialize config values into

type ValueProposer added in v1.0.0

type ValueProposer interface {
	// BeginValueProposals called when a config proposal is begun
	BeginValueProposals(tx interface{}, groups []string) (ValueDeserializer, []ValueProposer, error)

	// RollbackProposals called when a config proposal is abandoned
	RollbackProposals(tx interface{})

	// PreCommit is invoked before committing the config to catch
	// any errors which cannot be caught on a per proposal basis
	// TODO, rename other methods to remove Value/Proposal references
	PreCommit(tx interface{}) error

	// CommitProposals called when a config proposal is committed
	CommitProposals(tx interface{})
}

type Values added in v1.0.0

type Values interface {
	ValueDeserializer

	// Validate should ensure that the values set into the proto messages are correct
	// and that the new group values are allowed.  It also includes a tx ID in case cross
	// Handler invocations (ie to the MSP Config Manager) must be made
	Validate(interface{}, map[string]ValueProposer) error

	// Commit should call back into the Value handler to update the config
	Commit()
}

Values defines a mechanism to supply messages to unamrshal from config and a mechanism to validate the results

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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