github.com/yous1230/fabric@v2.0.0-beta.0.20191224111736-74345bee6ac2+incompatible/integration/nwo/config.go (about)

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package nwo
     8  
     9  // Config holds the basic information needed to generate
    10  // fabric configuration files.
    11  type Config struct {
    12  	Organizations []*Organization `yaml:"organizations,omitempty"`
    13  	Consortiums   []*Consortium   `yaml:"consortiums,omitempty"`
    14  	SystemChannel *SystemChannel  `yaml:"system_channel,omitempty"`
    15  	Channels      []*Channel      `yaml:"channels,omitempty"`
    16  	Consensus     *Consensus      `yaml:"consensus,omitempty"`
    17  	Orderers      []*Orderer      `yaml:"orderers,omitempty"`
    18  	Peers         []*Peer         `yaml:"peers,omitempty"`
    19  	Profiles      []*Profile      `yaml:"profiles,omitempty"`
    20  	Templates     *Templates      `yaml:"templates,omitempty"`
    21  }
    22  
    23  func (c *Config) RemovePeer(orgName, peerName string) {
    24  	peers := []*Peer{}
    25  	for _, p := range c.Peers {
    26  		if p.Organization != orgName || p.Name != peerName {
    27  			peers = append(peers, p)
    28  		}
    29  	}
    30  	c.Peers = peers
    31  }