-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.go
46 lines (40 loc) · 1.62 KB
/
deploy.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
44
45
46
package def
import (
validation "github.com/go-ozzo/ozzo-validation"
"github.com/hyperledger/burrow/deploy/def/rule"
)
type DeployArgs struct {
Address string `mapstructure:"," json:"," yaml:"," toml:","`
BinPath string `mapstructure:"," json:"," yaml:"," toml:","`
CurrentOutput string `mapstructure:"," json:"," yaml:"," toml:","`
Debug bool `mapstructure:"," json:"," yaml:"," toml:","`
DefaultAmount string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultFee string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultGas string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultOutput string `mapstructure:"," json:"," yaml:"," toml:","`
DefaultSets []string `mapstructure:"," json:"," yaml:"," toml:","`
Path string `mapstructure:"," json:"," yaml:"," toml:","`
Verbose bool `mapstructure:"," json:"," yaml:"," toml:","`
YAMLPath string `mapstructure:"," json:"," yaml:"," toml:","`
Jobs int `mapstructure:"," json:"," yaml:"," toml:","`
ProposeVerify bool `mapstructure:"," json:"," yaml:"," toml:","`
ProposeVote bool `mapstructure:"," json:"," yaml:"," toml:","`
Package *Package
}
func (do *DeployArgs) Validate() error {
return validation.ValidateStruct(do,
validation.Field(&do.DefaultAmount, rule.Uint64),
validation.Field(&do.DefaultFee, rule.Uint64),
validation.Field(&do.DefaultGas, rule.Uint64),
validation.Field(&do.Package),
)
}
type Package struct {
Account string
Jobs []*Job
}
func (pkg *Package) Validate() error {
return validation.ValidateStruct(pkg,
validation.Field(&pkg.Jobs),
)
}