INNER CODE UNIT · Go
init
mweagle/Sparta · apigateway_test.go:17
func init() {
randVal = time.Now().UTC().String()
}
type testRequest struct {
Message string
Request spartaAWSEvents.APIGatewayRequest
}
func testAPIGatewayLambda(ctx context.Context,
gatewayEvent spartaAWSEvents.APIGatewayRequest) (interface{}, error) {
logger, loggerOk := ctx.Value(ContextKeyLogger).(*zerolog.Logger)
if loggerOk {
logger.Info().Msg("Hello world structured log message")
}
// Return a message, together with the incoming input...
return spartaAPIGateway.NewResponse(http.StatusOK, &testRequest{