Fastly Compute C++ SDK
Loading...
Searching...
No Matches

A Compute Config Store. More...

#include <config_store.h>

Public Member Functions

fastly::expected< std::optional< std::string > > get (std::string_view key)
fastly::expected< bool > contains (std::string_view key)

Static Public Member Functions

static fastly::expected< ConfigStoreopen (std::string_view name)

Detailed Description

A Compute Config Store.

Member Function Documentation

◆ contains()

fastly::expected< bool > fastly::config_store::ConfigStore::contains ( std::string_view key)

Return true if the config_store contains an entry with the given key.

Examples

_run
auto store{fastly::ConfigStore::open("test config store")};
assert(store.contains("key").value());

◆ get()

fastly::expected< std::optional< std::string > > fastly::config_store::ConfigStore::get ( std::string_view key)

Lookup a value in this config store.

If successful, this function returns std::optional<std::string>> if an entry was found, or std::nullopt if no entry with the given key was found.

Examples

_run
auto store{fastly::ConfigStore::open("test config store")};
assert(store.get("bread").value() ==
"a usually baked and leavened food");
assert(
store.get("freedom").value() ==
"the absence of necessity, coercion, or constraint",
);
// Otherwise, `get` will return nullopt.
assert(store.get("zzzzz") == std::nullopt);

◆ open()

fastly::expected< ConfigStore > fastly::config_store::ConfigStore::open ( std::string_view name)
static

Open a config store, given its name.

Examples

_run
auto merriam{fastly::ConfigStore::open("merriam webster")};
auto oed{fastly::ConfigStore::open("oxford english config store")};
Examples
config_store.cpp.

The documentation for this class was generated from the following file: