-
Notifications
You must be signed in to change notification settings - Fork 0
/
templates.go
43 lines (36 loc) · 861 Bytes
/
templates.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package nwo
// Templates can be used to provide custom templates to GenerateConfigTree.
type Templates struct {
ConfigTx string `yaml:"configtx,omitempty"`
Core string `yaml:"core,omitempty"`
Crypto string `yaml:"crypto,omitempty"`
Orderer string `yaml:"orderer,omitempty"`
}
func (t *Templates) ConfigTxTemplate() string {
if t.ConfigTx != "" {
return t.ConfigTx
}
return DefaultConfigTxTemplate
}
func (t *Templates) CoreTemplate() string {
if t.Core != "" {
return t.Core
}
return DefaultCoreTemplate
}
func (t *Templates) CryptoTemplate() string {
if t.Crypto != "" {
return t.Crypto
}
return DefaultCryptoTemplate
}
func (t *Templates) OrdererTemplate() string {
if t.Orderer != "" {
return t.Orderer
}
return DefaultOrdererTemplate
}