This is a sample app to check whether the a9s KeyValue Service is working or not.
Make sure you installed Go on your machine, download this for macOS.
Download the application:
go get github.com/anynines/a9s-keyvalue-app
cd $GOPATH/src/github.com/anynines/a9s-keyvalue-app
Create a service on the a9s PaaS:
cf create-service a9s-keyvalue keyvalue8-single-ssl my-keyvalue-service
Push the app:
cf push --no-start
Bind the app:
cf bind-service keyvalue-app my-keyvalue-service
And start:
cf start keyvalue-app
At last, check the created url...
Start Valkey service with Docker:
docker run -d -p 6379:6379 valkey/valkey valkey-server --requirepass secret
Export a few environment variables and run the sample app:
export VALKEY_HOST=localhost
export VALKEY_PORT=6379
export VALKEY_PASSWORD=secret
export VALKEY_USERNAME=default
export APP_DIR=$PWD
go build
./a9s-keyvalue-app
To bind the app to other KeyValue services than a9s-keyvalue
, have a look at the VCAPServices
struct.