github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/api/uniter/action.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package uniter
     5  
     6  // Action represents a single instance of an Action call, by name and params.
     7  type Action struct {
     8  	name   string
     9  	params map[string]interface{}
    10  }
    11  
    12  // NewAction makes a new Action with specified name and params map.
    13  func NewAction(name string, params map[string]interface{}) (*Action, error) {
    14  	return &Action{name: name, params: params}, nil
    15  }
    16  
    17  // Name retrieves the name of the Action.
    18  func (a *Action) Name() string {
    19  	return a.name
    20  }
    21  
    22  // Params retrieves the params map of the Action.
    23  func (a *Action) Params() map[string]interface{} {
    24  	return a.params
    25  }