apache / openwhisk-client-go

Go client library for the Apache OpenWhisk platform
https://openwhisk.apache.org/
Apache License 2.0
35 stars 44 forks source link

adding start library for easy implementation of Go actions #70

Closed sciabarracom closed 6 years ago

sciabarracom commented 6 years ago

there is only one file, start.go providing the whisk.Start and whisk.StartWithArgs functions.

Those are helpers to implement Golang based actions as provided by the openwhisk-runtime-go

Basically they let you to define an action as

func action(event json.RawMessage) (json.RawMessage, error)

and create a main as

func main() { whisk.Start(action) }

or

func main(args []string) { whisk.StartWithArgs(action, args[1:]) }

the last one is a useful helper to try the function from the command line and make it compatible with the current docker skeleton.