Skip to main content

cloudv2

This module contains a Wing-based implementation of the built-in cloud library. It's a work in progresss as part of a migration for our internal codebase.

Here are the resources available so far:

  • Counter

Prerequisites​

Installation​

npm i @winglibs/cloudv2

Usage​

bring cloudv2 as cloud;

let counter = new cloud.Counter();

License​

This library is licensed under the MIT License.​

API Reference​

Table of Contents​

Counter (preflight class) ​

No description

Constructor​

new(props: CounterProps): Counter

Properties​

NameTypeDescription
initialnumNo description

Methods​

SignatureDescription
inflight dec(amount: num?, key: str?): numNo description
inflight inc(amount: num?, key: str?): numNo description
inflight peek(key: str?): numNo description
inflight set(value: num, key: str?): voidNo description

AwsCounter (preflight class) ​

No description

Constructor​

new(): AwsCounter

Properties​

No properties

Methods​

SignatureDescription
static from(c: ICounter): IAwsCounter?No description

ICounter (interface) ​

No description

Properties​

No properties

Methods​

SignatureDescription
inflight dec(amount: num?, key: str?): numDecrements the counter atomically by a certain amount and returns the previous value. - amount The amount to decrement by (defaults to 1) - key The key of the counter (defaults to "default")
inflight inc(amount: num?, key: str?): numIncrements the counter atomically by a certain amount and returns the previous value. - amount The amount to increment by (defaults to 1) - key The key of the counter (defaults to "default")
inflight peek(key: str?): numReturns the current value of the counter. - key The key of the counter (defaults to "default")
inflight set(value: num, key: str?): voidSets the value of the counter. - value The new value of the counter - key The key of the counter (defaults to "default")

IAwsCounter (interface) ​

No description

Properties​

No properties

Methods​

SignatureDescription
dynamoTableArn(): strNo description
dynamoTableName(): strNo description

CounterProps (struct) ​

No description

Properties​

NameTypeDescription
initialnum?The initial value of the counter @default 0