Module resty.riak.counter

Riak counter object.

Can only be used with resty.riak created client. These are generally just wrappers around the low level resty.riak.client functions

Functions

new (bucket, key) Create a new riak counter.
value (self) Get the value of the counter
decrement (self, amount) Decrement the counter
increment (self, amount) Increment the counter
decrement_and_return (self, amount) Decrement the counter and return its new value
increment_and_return (self, amount) Increment the counter and return its new value


Functions

new (bucket, key)
Create a new riak counter. This does not change anything in riak, it only sets up a Lua object. Generally, resty.riak.bucket.counter is prefered.

Parameters:

Returns:

    resty.riak.counter
value (self)
Get the value of the counter

Parameters:

Returns:

    number
decrement (self, amount)
Decrement the counter

Parameters:

Returns:

    boolean
increment (self, amount)
Increment the counter

Parameters:

Returns:

    boolean
decrement_and_return (self, amount)
Decrement the counter and return its new value

Parameters:

Returns:

    number
increment_and_return (self, amount)
Increment the counter and return its new value

Parameters:

Returns:

    number
generated by LDoc 1.3