Fastly Compute C++ SDK
Loading...
Searching...
No Matches
simple.h File Reference
#include <chrono>
#include <fastly/cache/core.h>
#include <fastly/expected.h>
#include <fastly/http/body.h>
#include <functional>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

class  fastly::cache::simple::CacheError
 Errors arising from cache operations. More...
class  fastly::cache::simple::CacheEntry
 The return type of the closure provided to get_or_set_with(). More...
class  fastly::cache::simple::PurgeOptions
 Options for purge operations. More...

Namespaces

namespace  fastly
namespace  fastly::cache
namespace  fastly::cache::simple
namespace  fastly::cache::simple::detail

Functions

std::string fastly::cache::simple::detail::surrogate_key_for_cache_key (std::span< const std::uint8_t > key, PurgeOptions::Scope scope)
fastly::cache::simple::CacheError fastly::cache::simple::detail::from_core_error (const fastly::cache::core::CacheError &err)
tl::expected< std::optional< http::Body >, CacheErrorfastly::cache::simple::get (std::span< const std::uint8_t > key)
tl::expected< std::optional< http::Body >, CacheErrorfastly::cache::simple::get (std::string_view key)
tl::expected< http::Body, CacheErrorfastly::cache::simple::get_or_set (std::span< const std::uint8_t > key, http::Body value, std::chrono::nanoseconds ttl)
tl::expected< http::Body, CacheErrorfastly::cache::simple::get_or_set (std::string_view key, http::Body value, std::chrono::nanoseconds ttl)
template<class F>
requires std::invocable<F> && std::same_as<std::invoke_result_t<F>, std::optional<CacheEntry>>
tl::expected< std::optional< http::Body >, CacheErrorfastly::cache::simple::get_or_set_with (std::span< const std::uint8_t > key, F make_entry)
template<class F>
tl::expected< std::optional< http::Body >, CacheErrorfastly::cache::simple::get_or_set_with (std::string_view key, F make_entry)
tl::expected< void, CacheErrorfastly::cache::simple::purge (std::span< const std::uint8_t > key)
tl::expected< void, CacheErrorfastly::cache::simple::purge (std::string_view key)
tl::expected< void, CacheErrorfastly::cache::simple::purge_with_opts (std::span< const std::uint8_t > key, const PurgeOptions &opts)
tl::expected< void, CacheErrorfastly::cache::simple::purge_with_opts (std::string_view key, const PurgeOptions &opts)