Download include/aws/core/config/ConfigAndCredentialsCacheManager.h from Shenghong/dai_env: direct link, hf CLI and curl.
- Browser
- Download file 4.26 kB
-
https://huggingface.co/Shenghong/dai_env/resolve/main/include/aws/core/config/ConfigAndCredentialsCacheManager.h
- Command line
-
hf download hf://Shenghong/dai_env/include/aws/core/config/ConfigAndCredentialsCacheManager.h
-
curl -L -o ConfigAndCredentialsCacheManager.h https://huggingface.co/Shenghong/dai_env/resolve/main/include/aws/core/config/ConfigAndCredentialsCacheManager.h
4.26 kB
| /** | |
| * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| * SPDX-License-Identifier: Apache-2.0. | |
| */ | |
| namespace Aws | |
| { | |
| namespace Config | |
| { | |
| /** | |
| * Stores the contents of config file and credentials file to avoid multiple file readings. | |
| * At the same time provides the flexibility to reload from file. | |
| */ | |
| class AWS_CORE_API ConfigAndCredentialsCacheManager | |
| { | |
| public: | |
| ConfigAndCredentialsCacheManager(); | |
| void ReloadConfigFile(); | |
| void ReloadCredentialsFile(); | |
| bool HasConfigProfile(const Aws::String& profileName) const; | |
| /** | |
| * Returns cached config profile with the specified profile name. | |
| * Using copy instead of const reference to avoid reading bad contents due to thread contention. | |
| */ | |
| Aws::Config::Profile GetConfigProfile(const Aws::String& profileName) const; | |
| /** | |
| * Returns cached config profiles | |
| * Using copy instead of const reference to avoid reading bad contents due to thread contention. | |
| */ | |
| Aws::Map<Aws::String, Aws::Config::Profile> GetConfigProfiles() const; | |
| /** | |
| * Returns cached config value with the specified profile name and key. | |
| * Using copy instead of const reference to avoid reading bad contents due to thread contention. | |
| */ | |
| Aws::String GetConfig(const Aws::String& profileName, const Aws::String& key) const; | |
| bool HasCredentialsProfile(const Aws::String& profileName) const; | |
| /** | |
| * Returns cached credentials profile with the specified profile name. | |
| * Using copy instead of const reference to avoid reading bad contents due to thread contention. | |
| */ | |
| Aws::Config::Profile GetCredentialsProfile(const Aws::String& profileName) const; | |
| /** | |
| * Returns cached credentials profiles. | |
| * Using copy instead of const reference to avoid reading bad contents due to thread contention. | |
| */ | |
| Aws::Map<Aws::String, Aws::Config::Profile> GetCredentialsProfiles() const; | |
| /** | |
| * Returns cached credentials with the specified profile name. | |
| * Using copy instead of const reference to avoid reading bad contents due to thread contention. | |
| */ | |
| Aws::Auth::AWSCredentials GetCredentials(const Aws::String& profileName) const; | |
| private: | |
| mutable Aws::Utils::Threading::ReaderWriterLock m_credentialsLock; | |
| Aws::Config::AWSConfigFileProfileConfigLoader m_credentialsFileLoader; | |
| mutable Aws::Utils::Threading::ReaderWriterLock m_configLock; | |
| Aws::Config::AWSConfigFileProfileConfigLoader m_configFileLoader; | |
| }; | |
| AWS_CORE_API void InitConfigAndCredentialsCacheManager(); | |
| AWS_CORE_API void CleanupConfigAndCredentialsCacheManager(); | |
| AWS_CORE_API void ReloadCachedConfigFile(); | |
| AWS_CORE_API void ReloadCachedCredentialsFile(); | |
| AWS_CORE_API bool HasCachedConfigProfile(const Aws::String& profileName); | |
| AWS_CORE_API Aws::Config::Profile GetCachedConfigProfile(const Aws::String& profileName); | |
| AWS_CORE_API Aws::Map<Aws::String, Aws::Config::Profile> GetCachedConfigProfiles(); | |
| AWS_CORE_API Aws::String GetCachedConfigValue(const Aws::String& profileName, const Aws::String& key); | |
| AWS_CORE_API Aws::String GetCachedConfigValue(const Aws::String& key); | |
| AWS_CORE_API bool HasCachedCredentialsProfile(const Aws::String &profileName); | |
| AWS_CORE_API Aws::Config::Profile GetCachedCredentialsProfile(const Aws::String& profileName); | |
| AWS_CORE_API Aws::Auth::AWSCredentials GetCachedCredentials(const Aws::String& profileName); | |
| AWS_CORE_API Aws::Map<Aws::String, Aws::Config::Profile> GetCachedCredentialsProfiles(); | |
| } | |
| } | |