Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hello ¶
func Hello(event json.RawMessage) (json.RawMessage, error)
Hello receive an event in format { "name": "Mike"} and returns a greeting in format { "greetings": "Hello, Mike"}
Example ¶
name := []byte(`{ "name": "Mike"}`) data, _ := Hello(name) fmt.Printf("%s", data)
Output: Hello, Mike {"greetings":"Hello, Mike"}
Example (BadJson) ¶
name := []byte(`{{`) _, err := Hello(name) fmt.Print(err)
Output: no name specified
Example (NoName) ¶
name := []byte(`{ "noname": "Mike"}`) _, err := Hello(name) fmt.Print(err)
Output: no name specified
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.