github.com/eris-ltd/erisdb@v0.25.0/deploy/def/deploy.go (about)

     1  package def
     2  
     3  import (
     4  	validation "github.com/go-ozzo/ozzo-validation"
     5  	"github.com/hyperledger/burrow/deploy/def/rule"
     6  )
     7  
     8  const DefaultOutputFile = "deploy.output.json"
     9  
    10  type DeployArgs struct {
    11  	Chain         string   `mapstructure:"," json:"," yaml:"," toml:","`
    12  	KeysService   string   `mapstructure:"," json:"," yaml:"," toml:","`
    13  	MempoolSign   bool     `mapstructure:"," json:"," yaml:"," toml:","`
    14  	Timeout       int      `mapstructure:"," json:"," yaml:"," toml:","`
    15  	Address       string   `mapstructure:"," json:"," yaml:"," toml:","`
    16  	BinPath       string   `mapstructure:"," json:"," yaml:"," toml:","`
    17  	CurrentOutput string   `mapstructure:"," json:"," yaml:"," toml:","`
    18  	Debug         bool     `mapstructure:"," json:"," yaml:"," toml:","`
    19  	DefaultAmount string   `mapstructure:"," json:"," yaml:"," toml:","`
    20  	DefaultFee    string   `mapstructure:"," json:"," yaml:"," toml:","`
    21  	DefaultGas    string   `mapstructure:"," json:"," yaml:"," toml:","`
    22  	DefaultOutput string   `mapstructure:"," json:"," yaml:"," toml:","`
    23  	DefaultSets   []string `mapstructure:"," json:"," yaml:"," toml:","`
    24  	Path          string   `mapstructure:"," json:"," yaml:"," toml:","`
    25  	Verbose       bool     `mapstructure:"," json:"," yaml:"," toml:","`
    26  	Jobs          int      `mapstructure:"," json:"," yaml:"," toml:","`
    27  	ProposeVerify bool     `mapstructure:"," json:"," yaml:"," toml:","`
    28  	ProposeVote   bool     `mapstructure:"," json:"," yaml:"," toml:","`
    29  	ProposeCreate bool     `mapstructure:"," json:"," yaml:"," toml:","`
    30  }
    31  
    32  func (args *DeployArgs) Validate() error {
    33  	return validation.ValidateStruct(args,
    34  		validation.Field(&args.DefaultAmount, rule.Uint64),
    35  		validation.Field(&args.DefaultFee, rule.Uint64),
    36  		validation.Field(&args.DefaultGas, rule.Uint64),
    37  	)
    38  }
    39  
    40  type Playbook struct {
    41  	Filename string
    42  	Account  string
    43  	Jobs     []*Job
    44  	Path     string `mapstructure:"-" json:"-" yaml:"-" toml:"-"`
    45  	BinPath  string `mapstructure:"-" json:"-" yaml:"-" toml:"-"`
    46  	// If we're in a proposal or meta job, reference our parent script
    47  	Parent *Playbook `mapstructure:"-" json:"-" yaml:"-" toml:"-"`
    48  }
    49  
    50  func (pkg *Playbook) Validate() error {
    51  	return validation.ValidateStruct(pkg,
    52  		validation.Field(&pkg.Jobs),
    53  	)
    54  }