github.com/metacurrency/holochain@v0.1.0-alpha-26.0.20200915073418-5c83169c9b5b/action_bundlestart.go (about)

     1  package holochain
     2  
     3  //------------------------------------------------------------
     4  // StartBundle
     5  
     6  const (
     7  	DefaultBundleTimeout = 5000
     8  )
     9  
    10  type APIFnStartBundle struct {
    11  	timeout   int64
    12  	userParam string
    13  }
    14  
    15  func NewStartBundleAction(timeout int, userParam string) *APIFnStartBundle {
    16  	a := APIFnStartBundle{timeout: int64(timeout), userParam: userParam}
    17  	if timeout == 0 {
    18  		a.timeout = DefaultBundleTimeout
    19  	}
    20  	return &a
    21  }
    22  
    23  func (a *APIFnStartBundle) Name() string {
    24  	return "bundleStart"
    25  }
    26  
    27  func (a *APIFnStartBundle) Args() []Arg {
    28  	return []Arg{{Name: "timeout", Type: IntArg}, {Name: "userParam", Type: StringArg}}
    29  }
    30  
    31  func (a *APIFnStartBundle) Call(h *Holochain) (response interface{}, err error) {
    32  	err = h.Chain().StartBundle(a.userParam)
    33  	return
    34  }