Giter Club home page Giter Club logo

go-aws-lambda's Introduction

AWS Lambda Go Application โšก

This repository contains a simple AWS Lambda function written in Go. The Lambda function receives an event, processes it, and returns a response. The function is triggered by the AWS Lambda service.

Overview ๐Ÿ”Ž

The Lambda function takes an event of type MyEvent with fields "Name" and "Age" and responds with a message indicating the provided name and age.

Input Event Structure

{
  "What is your name?": "Anjas",
  "How old are you?": 20
}

Output Response Structure

{
  "Answer: ": "Anjas is 20 years old"
}

Code Explanation ๐Ÿš€

main.go

The main.go file serves as the entry point for the AWS Lambda Go application.

  • Imports: The necessary packages are imported, including fmt for formatted I/O and github.com/aws/aws-lambda-go/lambda for AWS Lambda functionality.

  • Event Structures: Two structures, MyEvent and MyResponse, are defined to represent the input and output data formats for the Lambda function.

  • Handler Function: The handleLambdaEvent function processes the Lambda event and generates a response. It formats a message based on the provided name and age.

  • Main Function: The main function initiates the Lambda function by calling lambda.Start(), passing the handleLambdaEvent function as the handler.

Usage ๐Ÿ”ง

Invoke the Lambda function with an event similar to the provided MyEvent structure:

aws lambda invoke --function-name YourLambdaFunctionName --payload '{"What is your name?": "Anjas", "How old are you?": 20}' output.json

Closing Notes ๐Ÿ“

Feel free to adjust the configuration, and if you encounter any issues or have suggestions for improvement, please open an issue or submit a pull request.

Happy coding! ๐Ÿค–๐Ÿ‘จโ€๐Ÿ’ป

go-aws-lambda's People

Contributors

anjasfedo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.