Documentation ¶
Index ¶
- type Cache
- func (c *Cache) CacheDataExist(path string) bool
- func (c *Cache) CachePathExists(path string) bool
- func (c *Cache) GetCacheData(path string) DataRecord
- func (c *Cache) PreloadFolderPaths(folderPath string) error
- func (c *Cache) PreloadPaths(paths map[string]Paths) error
- func (c *Cache) UpdateCacheData(path string, data DataRecord) (bool, error)
- func (c *Cache) UpdateCachePath(path string, paths map[string]Paths) (bool, error)
- type CacheData
- type CachePath
- type Client
- type DataRecord
- type Paths
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { VaultClient Client CachePaths map[string]CachePath CacheDatas map[string]CacheData }
Cache - the interface
func (*Cache) CacheDataExist ¶
CacheDataExist - Check to see if we have the key/value pairs in cache
func (*Cache) CachePathExists ¶
CachePathExists - Check for the existance of a path in cache
func (*Cache) GetCacheData ¶
func (c *Cache) GetCacheData(path string) DataRecord
GetCacheData - Fetch the key/value data
func (*Cache) PreloadFolderPaths ¶
PreloadFolderPaths - called as a goroutine for each of the Folders at the current level.
func (*Cache) PreloadPaths ¶
PreloadPaths - called as a goroutine to pre-populate key/values for each KEY item
func (*Cache) UpdateCacheData ¶
func (c *Cache) UpdateCacheData(path string, data DataRecord) (bool, error)
UpdateCacheData - Add key/value data to the cache
type CacheData ¶
type CacheData struct { CacheTime time.Time Data DataRecord }
CacheData - key/value data cache
type Client ¶
type Client interface { GetVersion() (string, error) GetData(path string) (DataRecord, error) GetPaths(path string) (map[string]Paths, error) }
Client - Our primary client interface
type DataRecord ¶
type DataRecord struct { Data struct { Data map[string]interface{} `json:"data"` Metadata struct { CreatedTime string `json:"created_time"` DeletionTime string `json:"deletion_time"` Destroyed bool `json:"destroyed"` Version int `json:"version"` } `json:"metadata"` } `json:"data"` }
DataRecord - base vault record structure
Click to show internal directories.
Click to hide internal directories.