All Projects → lifadev → archive_aws-lambda-go-core

lifadev / archive_aws-lambda-go-core

Licence: Apache-2.0 license
Type definitions for AWS Lambda Go runtime.

Programming Languages

go
31211 projects - #10 most used programming language

Powered by Amazon Web Services Created by eawsy

eawsy/aws-lambda-go-core

Type definitions and helpers for AWS Lambda Go runtime.

Api Status License Help Social

AWS Lambda lets you run code without provisioning or managing servers. With eawsy/aws-lambda-go-shim, you can author your Lambda function code in Go. This project provides type definitions and helpers to deal with AWS Lambda Go runtime.

Preview

For step by step instructions on how to author your AWS Lambda function code in Go, see eawsy/aws-lambda-go-shim.

go get -u -d github.com/eawsy/aws-lambda-go-core/...
package main

import (
	"encoding/json"
	"log"
	"time"

	"github.com/eawsy/aws-lambda-go-core/service/lambda/runtime"
)

func Handle(evt json.RawMessage, ctx *runtime.Context) (interface{}, error) {
	log.Printf("Log stream name: %s\n", ctx.LogStreamName)
	log.Printf("Log group name: %s\n", ctx.LogGroupName)
	log.Printf("Request ID: %s\n", ctx.AWSRequestID)
	log.Printf("Mem. limits(MB): %d\n", ctx.MemoryLimitInMB)

	select {
	case <-time.After(1 * time.Second):
		log.Printf("Time remaining (MS): %d\n", ctx.RemainingTimeInMillis())
	}

	return nil, nil
}

About

eawsy

This project is maintained and funded by Alsanium, SAS.

We ❤️ AWS and open source software. See our other projects, or hire us to help you build modern applications on AWS.

Contact

We want to make it easy for you, users and contributers, to talk with us and connect with each others, to share ideas, solve problems and make help this project awesome. Here are the main channels we're running currently and we'd love to hear from you on them.

Twitter

eawsyhq

Follow and chat with us on Twitter.

Share stories!

Gitter

eawsy/bavardage

This is for all of you. Users, developers and curious. You can find help, links, questions and answers from all the community including the core team.

Ask questions!

GitHub

pull requests & issues

You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.

Before you start to code, we recommend discussing your plans through the eawsy/bavardage channel, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.

Write code!

License

This product is licensed to you under the Apache License, Version 2.0 (the "License"); you may not use this product except in compliance with the License. See LICENSE and NOTICE for more information.

Trademark

Alsanium, eawsy, the "Created by eawsy" logo, and the "eawsy" logo are trademarks of Alsanium, SAS. or its affiliates in France and/or other countries.

Amazon Web Services, the "Powered by Amazon Web Services" logo, and AWS Lambda are trademarks of Amazon.com, Inc. or its affiliates in the United States and/or other countries.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].