commit | 27685a38801dc1ffb97beb6abd8b37a206e448f0 | [log] [tgz] |
---|---|---|
author | Theodore Wilson <theodore.wilson@us.ibm.com> | Tue Jan 19 21:28:08 2016 -0800 |
committer | Theodore Wilson <theodore.wilson@us.ibm.com> | Tue Jan 19 21:28:08 2016 -0800 |
tree | 5d9d0bfd491baed90d50bf9fa0fb982f62b382db | |
parent | b041814528e9498b10e2ed88246e991c197e412f [diff] |
restructuring
import (
"net/http"
"net/url"
"github.ibm.com/Bluemix/go-whisk/whisk"
)
func main() {
client, err := whisk.New(http.DefaultClient, nil)
if err != nil {
fmt.Println(err)
os.Exit(-1)
}
options := &whisk.ActionListOptions{
Limit: 30,
Skip: 0,
}
actions, resp, err := client.Actions.List(options)
if err != nil {
fmt.Println(err)
os.Exit(-1)
}
fmt.Println("Returned with status: ", resp.Status)
fmt.Println("Returned actions: \n%+v", actions)
}
Whisk can be configured by passing in a *whisk.Config
object as the second argument to whisk.New( ... )
. Its declaration is:
package whisk type Config struct { Namespace string // NOTE :: Default is "_" AuthToken string BaseURL *url.URL // NOTE :: Default is "whisk.stage1.ng.bluemix.net" Version string Verbose bool }