Module riakc_register

Encapsulates a register data-type that stores an opaque binary value with last-write-wins semantics.

Behaviours: riakc_datatype.

Description

Encapsulates a register data-type that stores an opaque binary value with last-write-wins semantics. Like the other eventually-consistent types, the original fetched value is unmodified by setting the register. Instead, the new value is captured for later application in Riak.

Registers are only available as values in maps.

Data Types

register()

abstract datatype: register()

register_op()

register_op() = {assign, binary()}

Function Index

is_type/1Determines whether the passed term is a register container.
new/0Creates a new, empty register container type.
new/1Creates a new register type with the passed context.
new/2Creates a new register with the specified value and context.
set/2Sets the value of the register.
to_op/1Extracts an operation from the register that can be encoded into an update request.
type/0Returns the symbolic name of this container.
value/1Extracts the value of the register.

Function Details

is_type/1

is_type(T::term()) -> boolean()

Determines whether the passed term is a register container.

new/0

new() -> register()

Creates a new, empty register container type.

new/1

new(Context::riakc_datatype:context()) -> register()

Creates a new register type with the passed context. It's ignored, but we need this constructor for new nested (in maps) objects on the fly

new/2

new(Value::binary(), Context::riakc_datatype:context()) -> register()

Creates a new register with the specified value and context.

set/2

set(Value::binary(), Register::register()) -> register()

Sets the value of the register.

to_op/1

to_op(Register::register()) -> riakc_datatype:update(register_op())

Extracts an operation from the register that can be encoded into an update request.

type/0

type() -> atom()

Returns the symbolic name of this container.

value/1

value(Register::register()) -> binary() | undefined

Extracts the value of the register.


Generated by EDoc, Dec 16 2016, 16:38:08.