Skip to content

digitalocean/functions-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Working with DBaaS Redis Instance

Introduction

A serverless functions project to interact with a DBaaS Redis instance. This provides a Redis command line interface for your Redis instance to list keys, set/get/delete a key, expire a key or flush the Redis store. The list of available commands is available here.

You can deploy it as DigitalOcean Functions project. Documentation is available at https://docs.digitalocean.com/products/functions.

Requirements

Deploying the Function

# clone this repo
git clone git@github.com:digitalocean/functions-redis.git
# deploy the project
> doctl serverless deploy functions-redis
Deploying 'functions-redis'
  to namespace 'fn-...'
  on host 'https://faas-...'
...
Deployed functions ('doctl sls fn get <funcName> --url' for URL):
  - redis/cli
Set a key
doctl serverless functions invoke redis/cli -p command:set -p key:mykey -p value:myval
{
  "value": "OK"
}
List all keys
doctl serverless functions invoke redis/cli -p command:keys
{
  "value": [
    "mykey"
  ]
}
Get a key
doctl serverless functions invoke redis/cli -p command:get -p key:mykey
{
  "value": "myval"
}
Flush all keys
doctl serverless functions invoke redis/cli -p command:flush -p flush:true
{
  "value": true
}

Note the CLI command can be abbreviated as doctl sls fn invoke redis/cli.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published