go-lambda-linebot

go-lambda-linebot provides a functionality to parse event.APIGatewayProxyRequest and turn it into an array of linebot.Event. This is useful especially when you create LINE bot using their Messaging API with AWS Lambda and API Gateway.
Example
package main
import (
"os"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/shuheiktgw/go-lambda-linebot/parser"
)
func handler(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
lineEvents, err := parser.ParseRequest(os.Getenv("CHANNEL_SECRET"), &request)
# Do something useful...
}
func main() {
lambda.Start(handler)
}
The implementation of parser.ParseRequest follows webhook.go in line/line-bot-sdk-go.
Install
$ go get github.com/shuheiktgw/go-lambda-linebot/parser
Author
Shuhei Kitagawa