plowforce
REST API to connect backend services to Salesforce.
Build Status
Code Coverage
Here
Compiling
go build .
Running
go run . Server starting
Usage Instructions
Deployment Instructions
Build main go executeable:
GOOS=linux go build -o main main.go
Zip up executeable:
zip deployment.zip main
Create AWS Lambda:
aws lambda create-function --function-name sls-plowforce-{ENV}-plow
--description "Salesforce API function"
--runtime go1.x
--role {AWS-ARN-ROLE}
--handler main
--environment 'Variables={ENV="dev", SENTRY_DSN=""}'
--timeout 30 \
--memory-size 1024
--zip-file fileb://./deployment.zip
--region us-west-2
To redploy/update build and zip per above, then:
aws lambda update-function-code --function-name sls-plowforce-{ENV}-plow
--zip-file fileb://./deployment.zip
--region us-west-2
To add environment variables to lamda:
aws lambda update-function-configuration --function-name sls-plowforce-dev-plow
--environment 'Variables={sfUser="", sfPassword="", sfURL="", sfToken="", SENTRY_DSN="<SENTRY_DSN>"}'
Pre-commit Hook Installation
- pip install pre-commit
- pre-commit install
Testing
To test all files and functions with verbose output run:
go test ./... --cover -v