Nimbus

Nimbus

  • Docs
  • Getting Started
  • Help

›Clients

Documentation

  • Introduction
  • Deployment

Deploying Resources

  • File Storage Bucket
  • Document Store
  • Key-Value Store
  • Relational Database
  • Functions

    • HTTP Function
    • WebSocket Function
    • Document Store Function
    • Key-Value Store Function
    • Notification Function
    • Queue Function
    • Basic Function
    • File Storage Function
    • After Deployment Function
    • Environment Variables

Clients

  • Document Store Client
  • Key-Value Store Client
  • File Storage Client
  • WebSocket Management Client
  • Basic Serverless Function Client
  • Notification Topic Client
  • Queue Client
  • Relational Database Client
  • Environment Variable Client

Local Deployment

  • Unit Testing
  • Local Server

Key-Value Store Client

A key-value store client allows you to interact with a key-value store in a manner that is similar to a Map<>.

Initialisation

A key-value store client has two type parameters which should correspond to a class that is annotated with @KeyValueStore and a key type. The key type should match the one found on the @KeyValueStore declaration.

To get an instance of a KeyValueStoreClient you do:

KeyValueStoreClient<KeyType, ValueType> client = ClientBuilder.getKeyValueStoreClient(KeyType.class, ValueType.class);

In addition the serverless function from which the client is used needs to be annotated with @UsesKeyValueStore(ValueType.class), to handle cloud permissions.

In this example ValueType would be replaced with your class that you have annotated with @KeyValueStore.

KeyValueStoreClient Methods

  • put(K key, V value) - Inserts value into the key-value store at key, replacing any value already there.

  • delete(K key) - Removes the object corresponding to this key from the store.

  • Map<K, V> getAll() - Returns a map of key-value of all items in the store.

  • V get(K key) - Returns the object corresponding to the key. Returns null if no object found.

Annotation Specification

@UsesKeyValueStore

Required Parameters

  • dataModel - The class annotated with @KeyValueStore that this function will access.

Optional Parameters

  • stages - The stages which this function has access to the key-value store
← Document Store ClientFile Storage Client →
  • Initialisation
  • KeyValueStoreClient Methods
  • Annotation Specification
    • @UsesKeyValueStore
Nimbus
Docs
Getting StartedDocumentation
More
GitHubStar
Copyright © 2019 Thomas Allerton