The AWS Lambda functions used for the dog.ceo api.
go get -u github.com/ElliottLandsborough/dog-ceo-api-golang
cd $GOPATH/src/github.com/ElliottLandsborough/dog-ceo-api-golang
make deps
make clean
make build
make start- AWS CLI already configured with Administrator permission
- Docker installed
- Golang
go get ./...makeNOTE: If you're not building the function on a Linux machine, you will need to specify the GOOS and GOARCH environment variables, this allows Golang to build your function for another system architecture and ensure compatibility.
Invoking function locally through local API Gateway
brew install aws-sam-cli
brew install awscli
make build && make startbrew install aws-sam-cli
brew install awscli
make deploy
-- OR --
make ENVIRONMENT=production deployWe use testing package that is built-in in Golang and you can simply run the following command to run our tests:
make test{
"listAllBreeds": {
"IMAGE_BUCKET_NAME": "dog-ceo-stanford-files",
"FILE_BUCKET_NAME": "dog-ceo-api-static-content-dev",
"BUCKET_REGION": "eu-west-1",
"CDN_DOMAIN_PREFIX": "https://images.dog.ceo/breeds/"
},
"listBreeds": {
"IMAGE_BUCKET_NAME": "dog-ceo-stanford-files",
"FILE_BUCKET_NAME": "dog-ceo-api-static-content-dev",
"BUCKET_REGION": "eu-west-1",
"CDN_DOMAIN_PREFIX": "https://images.dog.ceo/breeds/"
}
}