#include <userver/storages/secdist/secdist.hpp>
Client to retrieve credentials from the components::Secdist and to subscribe to their updates.
Definition at line 112 of file secdist.hpp.
Public Member Functions | |
| Secdist (SecdistConfig::Settings settings) | |
| const storages::secdist::SecdistConfig & | Get () const |
| rcu::ReadablePtr< storages::secdist::SecdistConfig > | GetSnapshot () const |
| template<typename Class> | |
| void | UpdateAndListen (utils::ResourceScopeStorage &scopes, Class *obj, std::string_view name, void(Class::*func)(const storages::secdist::SecdistConfig &secdist)) |
| template<typename Class> | |
| concurrent::AsyncEventSubscriberScope | UpdateAndListen (Class *obj, std::string_view name, void(Class::*func)(const storages::secdist::SecdistConfig &secdist)) |
| bool | IsPeriodicUpdateEnabled () const noexcept |
| const storages::secdist::SecdistConfig & storages::secdist::Secdist::Get | ( | ) | const |
Returns secdist data loaded on service start. Does not support secdist updating during service work.
| rcu::ReadablePtr< storages::secdist::SecdistConfig > storages::secdist::Secdist::GetSnapshot | ( | ) | const |
Returns fresh secdist data (from last update). Supports secdist updating during service work.
| concurrent::AsyncEventSubscriberScope storages::secdist::Secdist::UpdateAndListen | ( | Class * | obj, |
| std::string_view | name, | ||
| void(Class::* | func )(const storages::secdist::SecdistConfig &secdist) ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Store the returned scope as a member and call Unsubscribe explicitly.
Definition at line 188 of file secdist.hpp.
| void storages::secdist::Secdist::UpdateAndListen | ( | utils::ResourceScopeStorage & | scopes, |
| Class * | obj, | ||
| std::string_view | name, | ||
| void(Class::* | func )(const storages::secdist::SecdistConfig &secdist) ) |
Subscribes to secdist updates using a member function, named OnSecdistUpdate by convention. Also immediately invokes the function with the current secdist data.
Further updates are delivered after utils::ResourceScopeStorage::AfterConstruction, including those updates that arrived before it. Unsubscribe runs in utils::ResourceScopeStorage::BeforeDestruction.
| scopes | storage that owns the subscription lifetime. In a component constructor pass context.Scopes() or components::GetResourceScopes. |
Definition at line 176 of file secdist.hpp.