Created
January 22, 2018 02:27
-
-
Save mweagle/a90252140cb21d172f96976092cab168 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type helloWorldResponse struct { | |
Message string | |
Request spartaAPIG.APIGatewayRequest | |
} | |
//////////////////////////////////////////////////////////////////////////////// | |
// Hello world event handler | |
func helloWorld(ctx context.Context, | |
gatewayEvent spartaAPIG.APIGatewayRequest) (helloWorldResponse, error) { | |
logger, loggerOk := ctx.Value(sparta.ContextKeyLogger).(*logrus.Logger) | |
if loggerOk { | |
logger.Info("Hello world structured log message") | |
} | |
// Return a message, together with the incoming input... | |
return helloWorldResponse{ | |
Message: fmt.Sprintf("Hello world 🌏"), | |
Request: gatewayEvent, | |
}, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment