Documentation ¶
Index ¶
- Constants
- type FileCacheSecretStoreStrategy
- func (fs *FileCacheSecretStoreStrategy) Close() error
- func (fs *FileCacheSecretStoreStrategy) GetCacheSecretInfo(secretName string) (*models.CacheSecretInfo, error)
- func (fs *FileCacheSecretStoreStrategy) Init() error
- func (fs *FileCacheSecretStoreStrategy) StoreSecret(cacheSecretInfo *models.CacheSecretInfo) error
- type MemoryCacheSecretStoreStrategy
- func (ms *MemoryCacheSecretStoreStrategy) Close() error
- func (ms *MemoryCacheSecretStoreStrategy) GetCacheSecretInfo(secretName string) (*models.CacheSecretInfo, error)
- func (ms *MemoryCacheSecretStoreStrategy) Init() error
- func (ms *MemoryCacheSecretStoreStrategy) StoreSecret(cacheSecretInfo *models.CacheSecretInfo) error
- type SecretCacheHook
- type SecretCacheStoreStrategy
Constants ¶
View Source
const ( JsonFileNamePrefix = "stage_" JsonFileNameSuffix = ".json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileCacheSecretStoreStrategy ¶
type FileCacheSecretStoreStrategy struct { // 缓存凭据文件路径 CacheSecretPath string // 首次启动时候是否允许从文件进行加载,true为允许 ReloadOnStart bool //加解密过程中使用的salt Salt string ReloadedSet mapset.Set CacheSecretInfoMap cmap.ConcurrentMap }
func NewFileCacheSecretStoreStrategy ¶
func NewFileCacheSecretStoreStrategy(cacheSecretPath string, reloadOnStart bool, salt string) *FileCacheSecretStoreStrategy
func (*FileCacheSecretStoreStrategy) Close ¶
func (fs *FileCacheSecretStoreStrategy) Close() error
func (*FileCacheSecretStoreStrategy) GetCacheSecretInfo ¶
func (fs *FileCacheSecretStoreStrategy) GetCacheSecretInfo(secretName string) (*models.CacheSecretInfo, error)
func (*FileCacheSecretStoreStrategy) Init ¶
func (fs *FileCacheSecretStoreStrategy) Init() error
func (*FileCacheSecretStoreStrategy) StoreSecret ¶
func (fs *FileCacheSecretStoreStrategy) StoreSecret(cacheSecretInfo *models.CacheSecretInfo) error
type MemoryCacheSecretStoreStrategy ¶
type MemoryCacheSecretStoreStrategy struct {
CacheSecretInfoMap cmap.ConcurrentMap
}
func NewMemoryCacheSecretStoreStrategy ¶
func NewMemoryCacheSecretStoreStrategy() *MemoryCacheSecretStoreStrategy
func (*MemoryCacheSecretStoreStrategy) Close ¶
func (ms *MemoryCacheSecretStoreStrategy) Close() error
func (*MemoryCacheSecretStoreStrategy) GetCacheSecretInfo ¶
func (ms *MemoryCacheSecretStoreStrategy) GetCacheSecretInfo(secretName string) (*models.CacheSecretInfo, error)
func (*MemoryCacheSecretStoreStrategy) Init ¶
func (ms *MemoryCacheSecretStoreStrategy) Init() error
func (*MemoryCacheSecretStoreStrategy) StoreSecret ¶
func (ms *MemoryCacheSecretStoreStrategy) StoreSecret(cacheSecretInfo *models.CacheSecretInfo) error
type SecretCacheHook ¶
type SecretCacheHook interface { // 初始化Hook Init() error // 将secret对象转化为Cache secret对象 Put(o *models.SecretInfo) (*models.CacheSecretInfo, error) // 将Cache secret对象转化为secret对象 Get(cachedObject *models.CacheSecretInfo) (*models.SecretInfo, error) // RecoveryGetSecret RecoveryGetSecret(secretName string) (*models.SecretInfo, error) // 关闭,释放资源 Close() error }
func NewDefaultSecretCacheHook ¶
func NewDefaultSecretCacheHook(stage string) SecretCacheHook
type SecretCacheStoreStrategy ¶
type SecretCacheStoreStrategy interface { // 初始化凭据缓存 Init() error // 缓存secret信息 StoreSecret(cacheSecretInfo *models.CacheSecretInfo) error // 获取secret缓存信息 GetCacheSecretInfo(secretName string) (*models.CacheSecretInfo, error) // 关闭,释放资源 Close() error }
SecretCacheStoreStrategy 缓存secret策略
Click to show internal directories.
Click to hide internal directories.