action

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

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

func Main

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

Main forwarding to Hello

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL