diff options
| author | Per Larsson <[email protected]> | 2022-02-03 15:40:04 +0100 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2022-02-03 15:40:04 +0100 |
| commit | d6741139e1ea3c6bb1462da61a81c42a80ac6e59 (patch) | |
| tree | a422d3f591c954e9f5a20c6a28f60bd08923185e /zenserver/upstream/upstreamcache.h | |
| parent | Merge branch 'main' into auth (diff) | |
| download | zen-d6741139e1ea3c6bb1462da61a81c42a80ac6e59.tar.xz zen-d6741139e1ea3c6bb1462da61a81c42a80ac6e59.zip | |
Minor cleanup of free functions.
Diffstat (limited to 'zenserver/upstream/upstreamcache.h')
| -rw-r--r-- | zenserver/upstream/upstreamcache.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/zenserver/upstream/upstreamcache.h b/zenserver/upstream/upstreamcache.h index 4ccc56f79..6f18b3119 100644 --- a/zenserver/upstream/upstreamcache.h +++ b/zenserver/upstream/upstreamcache.h @@ -129,11 +129,11 @@ ToString(UpstreamEndpointState State) struct UpstreamAuthConfig { - std::string_view OAuthUrl; - std::string_view OAuthClientId; - std::string_view OAuthClientSecret; - std::string_view OpenIdProvider; - std::string_view AccessToken; + std::string_view OAuthUrl; + std::string_view OAuthClientId; + std::string_view OAuthClientSecret; + std::string_view OpenIdProvider; + std::string_view AccessToken; }; struct UpstreamEndpointStatus @@ -175,6 +175,12 @@ public: std::span<IoBuffer const> Payloads) = 0; virtual UpstreamEndpointStats& Stats() = 0; + + static std::unique_ptr<UpstreamEndpoint> CreateZenEndpoint(const ZenStructuredCacheClientOptions& Options); + + static std::unique_ptr<UpstreamEndpoint> CreateJupiterEndpoint(const CloudCacheClientOptions& Options, + const UpstreamAuthConfig& AuthConfig, + AuthMgr& Mgr); }; /** @@ -199,17 +205,8 @@ public: virtual void EnqueueUpstream(UpstreamCacheRecord CacheRecord) = 0; virtual void GetStatus(CbObjectWriter& CbO) = 0; -}; - -std::unique_ptr<UpstreamCache> MakeUpstreamCache(const UpstreamCacheOptions& Options, ZenCacheStore& CacheStore, CidStore& CidStore); -std::unique_ptr<UpstreamEndpoint> MakeJupiterUpstreamEndpoint(const CloudCacheClientOptions& Options); - -std::unique_ptr<UpstreamEndpoint> MakeJupiterUpstreamEndpoint(const CloudCacheClientOptions& Options); -std::unique_ptr<UpstreamEndpoint> MakeJupiterUpstreamEndpoint(const CloudCacheClientOptions& Options, - const UpstreamAuthConfig& AuthConfig, - AuthMgr& Mgr); - -std::unique_ptr<UpstreamEndpoint> MakeZenUpstreamEndpoint(const ZenStructuredCacheClientOptions& Options); + static std::unique_ptr<UpstreamCache> Create(const UpstreamCacheOptions& Options, ZenCacheStore& CacheStore, CidStore& CidStore); +}; } // namespace zen |