github.com/anjalikarhana/fabric@v2.1.1+incompatible/integration/nwo/templates.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 // Templates can be used to provide custom templates to GenerateConfigTree. 10 type Templates struct { 11 ConfigTx string `yaml:"configtx,omitempty"` 12 Core string `yaml:"core,omitempty"` 13 Crypto string `yaml:"crypto,omitempty"` 14 Orderer string `yaml:"orderer,omitempty"` 15 } 16 17 func (t *Templates) ConfigTxTemplate() string { 18 if t.ConfigTx != "" { 19 return t.ConfigTx 20 } 21 return DefaultConfigTxTemplate 22 } 23 24 func (t *Templates) CoreTemplate() string { 25 if t.Core != "" { 26 return t.Core 27 } 28 return DefaultCoreTemplate 29 } 30 31 func (t *Templates) CryptoTemplate() string { 32 if t.Crypto != "" { 33 return t.Crypto 34 } 35 return DefaultCryptoTemplate 36 } 37 38 func (t *Templates) OrdererTemplate() string { 39 if t.Orderer != "" { 40 return t.Orderer 41 } 42 return DefaultOrdererTemplate 43 }