commit | f12acef8b0cce3d0b8bd61d286df0d82a11faa77 | [log] [tgz] |
---|---|---|
author | Theodore Wilson <theodore.wilson@us.ibm.com> | Tue Jan 19 21:08:59 2016 -0800 |
committer | Theodore Wilson <theodore.wilson@us.ibm.com> | Tue Jan 19 21:08:59 2016 -0800 |
tree | f673f678a464d6444ddc106cfa3ff1ab138b1eb2 | |
parent | 0c4e5cf606d34bfb4cd1c21d3181b4d8294344ce [diff] |
added readme; fetch -> get
import (
"net/http"
"net/url"
whisk "github.ibm.com/Bluemix/go-whisk"
)
func main() {
httpClient := http.DefaultClient
whisk, err := whisk.New(httpClient, nil)
if err != nil {
fmt.Println(err)
os.Exit(-1)
}
actions, resp, err := whisk.Actions.Get("actionName")
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 }