InsertBuilder
Include fastly/kv_store.h to use this class.
Methods
background_fetch
View sourceInsertBuilder fastly::kv_store::InsertBuilder::background_fetch() &&If set, allows fetching from the origin to occur in the background, enabling a faster response with stale content. The cache will be updated with fresh content after the request is completed.
Returns
execute
View sourceInitiate and wait on an insert of a value into the KV Store. The return object is engaged if the value was inserted, and KVStoreError if the insert failed.
Parameters
Returns
execute_async
View sourceexpected<PendingInsertHandle> fastly::kv_store::InsertBuilder::execute_async(const std::string &key, Body body) &&Initiate async insert of a value into the KV Store.
Parameters
Returns
if_generation_match
View sourceInsertBuilder fastly::kv_store::InsertBuilder::if_generation_match(std::uint64_t gen) &&Requests for keys will return a ‘generation’ header specific to the version of a key. The generation header is a unique, non-serial 64-bit unsigned integer that can be used for testing against a specific KV store value.
Parameters
- gen: std::uint64_t
Returns
metadata
View sourceSets an arbitrary data field which can contain up to 2000B of data.
Parameters
- data: const std::string &
Returns
mode
View sourceChange the behavior in the case when the new key matches an existing key.
Parameters
- mode: InsertMode
Returns
time_to_live
View sourceInsertBuilder fastly::kv_store::InsertBuilder::time_to_live(std::chrono::milliseconds ttl) &&Sets a time for the key to expire. Deletion will take place up to 24 hours after the ttl reaches 0.
Parameters
- ttl: std::chrono::milliseconds
Returns