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

     1  /*
     2  Copyright IBM Corp. All Rights Reserved.
     3  
     4  SPDX-License-Identifier: Apache-2.0
     5  */
     6  
     7  package fabricconfig
     8  
     9  import "time"
    10  
    11  type ConfigTx struct {
    12  	Organizations []*Organization     `yaml:"Organizations,omitempty"`
    13  	Capabilities  *Capabilities       `yaml:"Capabilities,omitempty"`
    14  	Application   *Application        `yaml:"Application,omitempty"`
    15  	Orderer       *ConfigTxOrderer    `yaml:"Orderer,omitempty"`
    16  	Channel       *Channel            `yaml:"Channel,omitempty"`
    17  	Profiles      map[string]*Channel `yaml:"Profiles,omitempty"`
    18  
    19  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    20  }
    21  
    22  type Organization struct {
    23  	Name             string             `yaml:"Name,omitempty"`
    24  	SkipAsForeign    bool               `yaml:"SkipAsForeign,omitempty"`
    25  	ID               string             `yaml:"ID,omitempty"`
    26  	MSPDir           string             `yaml:"MSPDir,omitempty"`
    27  	Policies         map[string]*Policy `yaml:"Policies,omitempty"`
    28  	OrdererEndpoints []string           `yaml:"OrdererEndpoints,omitempty"`
    29  	AnchorPeers      []*AnchorPeer      `yaml:"AnchorPeers,omitempty"`
    30  
    31  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    32  }
    33  
    34  type Policy struct {
    35  	Type string `yaml:"Type,omitempty"`
    36  	Rule string `yaml:"Rule,omitempty"`
    37  
    38  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    39  }
    40  
    41  type Capabilities struct {
    42  	Channel     map[string]bool `yaml:"Channel,omitempty"`
    43  	Orderer     map[string]bool `yaml:"Orderer,omitempty"`
    44  	Application map[string]bool `yaml:"Application,omitempty"`
    45  
    46  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    47  }
    48  
    49  type AnchorPeer struct {
    50  	Host string `yaml:"Host,omitempty"`
    51  	Port int    `yaml:"Port,omitempty"`
    52  
    53  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    54  }
    55  
    56  type Application struct {
    57  	ACLs          map[string]string  `yaml:"ACLs,omitempty"`
    58  	Organizations []*Organization    `yaml:"Organizations,omitempty"`
    59  	Policies      map[string]*Policy `yaml:"Policies,omitempty"`
    60  	Capabilities  map[string]bool    `yaml:"Capabilities,omitempty"`
    61  
    62  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    63  }
    64  
    65  type ConfigTxOrderer struct {
    66  	OrdererType   string             `yaml:"OrdererType,omitempty"`
    67  	BatchTimeout  time.Duration      `yaml:"BatchTimeout,omitempty"`
    68  	BatchSize     *BatchSize         `yaml:"BatchSize,omitempty"`
    69  	Kafka         *ConfigTxKafka     `yaml:"Kafka,omitempty"`
    70  	EtcdRaft      *ConfigTxEtcdRaft  `yaml:"EtcdRaft,omitempty"`
    71  	Organizations []*Organization    `yaml:"Organizations,omitempty"`
    72  	Policies      map[string]*Policy `yaml:"Policies,omitempty"`
    73  	Capabilities  map[string]bool    `yaml:"Capabilities,omitempty"`
    74  
    75  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    76  }
    77  
    78  type BatchSize struct {
    79  	MaxMessageCount   string `yaml:"MaxMessageCount,omitempty"`
    80  	AbsoluteMaxBytes  string `yaml:"AbsoluteMaxBytes,omitempty"`
    81  	PreferredMaxBytes string `yaml:"PreferredMaxBytes,omitempty"`
    82  
    83  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    84  }
    85  
    86  type ConfigTxKafka struct {
    87  	Brokers []string `yaml:"Brokers,omitempty"`
    88  
    89  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    90  }
    91  
    92  type ConfigTxEtcdRaft struct {
    93  	Consenters []*Consenter     `yaml:"Consenters,omitempty"`
    94  	Options    *EtcdRaftOptions `yaml:"EtcdRaftOptions,omitempty"`
    95  
    96  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
    97  }
    98  
    99  type Consenter struct {
   100  	Host          string `yaml:"Host,omitempty"`
   101  	Port          int    `yaml:"Port,omitempty"`
   102  	ClientTLSCert string `yaml:"ClientTLSCert,omitempty"`
   103  	ServerTLSCert string `yaml:"ServerTLSCert,omitempty"`
   104  
   105  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
   106  }
   107  
   108  type EtcdRaftOptions struct {
   109  	TickInterval         string `yaml:"TickInterval,omitempty"`
   110  	ElectionTick         string `yaml:"ElectionTick,omitempty"`
   111  	HeartbeatTick        string `yaml:"HeartbeatTick,omitempty"`
   112  	MaxInflightBlocks    string `yaml:"MaxInflightBlocks,omitempty"`
   113  	SnapshotIntervalSize string `yaml:"SnapshotIntervalSize,omitempty"`
   114  
   115  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
   116  }
   117  
   118  type Channel struct {
   119  	Orderer      *ConfigTxOrderer       `yaml:"Orderer,omitempty"`
   120  	Application  *Application           `yaml:"Application,omitempty"`
   121  	Policies     map[string]*Policy     `yaml:"Policies,omitempty"`
   122  	Capabilities map[string]bool        `yaml:"Capabilities,omitempty"`
   123  	Consortiums  map[string]*Consortium `yaml:"Consortiums,omitempty"`
   124  
   125  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
   126  }
   127  
   128  type Consortium struct {
   129  	Organizations []*Organization `yaml:"Organizations,omitempty"`
   130  
   131  	ExtraProperties map[string]interface{} `yaml:",inline,omitempty"`
   132  }