Starting from version 1.26 Serverless Framework includes two Golang templates:
aws-go
- basic template with two functionsaws-go-dep
- recommended template usingdep
package manager
You can use them with create
command:
serverless create -t aws-go-dep
Original README below.
This repository contains template for creating serverless services written in Golang.
- Create a new service based on this template
serverless create -u https://github.com/serverless/serverless-golang/ -p myservice
- Compile function
cd myservice
GOOS=linux go build -o bin/main
- Deploy!
serverless deploy
You need csv file on root directory if you run it.
run & result
$ serverless invoke -f parse
{
"version": "1st&substream",
"title": "GRADIUSIC CYBER",
"genre": "DIGI-ROCK",
"artist": "TAKA",
"playcount": 1,
"normal": {
"level": 5,
"exscore": 0,
"pgreat": 0,
"great": 0,
"miss": 0,
"cleartype": "NO PLAY",
"djlevel": "---"
},
"hyper": {
"level": 6,
"exscore": 0,
"pgreat": 0,
"great": 0,
"miss": 0,
"cleartype": "NO PLAY",
"djlevel": "---"
},
"another": {
"level": 7,
"exscore": 697,
"pgreat": 260,
"great": 177,
"miss": 27,
"cleartype": "CLEAR",
"djlevel": "B"
},
"lastplayeddate": "2017-10-12T13:24:00Z"
}