/
runmode.go
40 lines (30 loc) · 1.01 KB
/
runmode.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
package conf
// PrivateBlockchain const label for running mode
const privateBlockchain RunMode = "PrivateBlockchain"
// PublicBlockchain const label for running mode
const publicBlockchain RunMode = "PublicBlockchain"
// VDEManager const label for running mode
const vdeMaster RunMode = "VDEMaster"
// VDE const label for running mode
const vde RunMode = "VDE"
type RunMode string
// IsPublicBlockchain returns true if mode equal PublicBlockchain
func (rm RunMode) IsPublicBlockchain() bool {
return rm == publicBlockchain
}
// IsPrivateBlockchain returns true if mode equal PrivateBlockchain
func (rm RunMode) IsPrivateBlockchain() bool {
return rm == privateBlockchain
}
// IsVDEMaster returns true if mode equal vdeMaster
func (rm RunMode) IsVDEMaster() bool {
return rm == vdeMaster
}
// IsVDE returns true if mode equal vde
func (rm RunMode) IsVDE() bool {
return rm == vde
}
// IsSupportingVDE returns true if mode support vde
func (rm RunMode) IsSupportingVDE() bool {
return rm.IsVDE() || rm.IsVDEMaster()
}