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
- Classes
- Interfaces
- Structs
Counter (preflight class)
No description
Constructor
new(props: CounterProps): Counter
Properties
Name | Type | Description |
---|---|---|
initial | num | No description |
Methods
Signature | Description |
---|---|
inflight dec(amount: num?, key: str?): num | No description |
inflight inc(amount: num?, key: str?): num | No description |
inflight peek(key: str?): num | No description |
inflight set(value: num, key: str?): void | No description |
AwsCounter (preflight class)
No description
Constructor
new(): AwsCounter
Properties
No properties
Methods
Signature | Description |
---|---|
static from(c: ICounter): IAwsCounter? | No description |
ICounter (interface)
No description
Properties
No properties
Methods
Signature | Description |
---|---|
inflight dec(amount: num?, key: str?): num | Decrements 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?): num | Increments 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?): num | Returns the current value of the counter. - key The key of the counter (defaults to "default") |
inflight set(value: num, key: str?): void | Sets 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