diff options
author | Michael Muré <batolettre@gmail.com> | 2019-05-27 21:18:46 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-05-27 21:39:55 +0200 |
commit | d564e37b317a2d59a9694d80b03b40e5d36f741f (patch) | |
tree | ba6bcdca38286372293b65f3c0b087cf95c066a1 /cache/repo_cache.go | |
parent | c7abac388aadd274d4f23f996a15f8bba90f2a92 (diff) | |
download | git-bug-d564e37b317a2d59a9694d80b03b40e5d36f741f.tar.gz git-bug-d564e37b317a2d59a9694d80b03b40e5d36f741f.zip |
repository: add ReadConfigBool and ReadConfigString functions
Diffstat (limited to 'cache/repo_cache.go')
-rw-r--r-- | cache/repo_cache.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cache/repo_cache.go b/cache/repo_cache.go index 01e5a4a9b..dc1889b2b 100644 --- a/cache/repo_cache.go +++ b/cache/repo_cache.go @@ -37,6 +37,8 @@ func (e ErrInvalidCacheFormat) Error() string { return e.message } +var _ repository.RepoCommon = &RepoCache{} + // RepoCache is a cache for a Repository. This cache has multiple functions: // // 1. After being loaded, a Bug is kept in memory in the cache, allowing for fast @@ -127,6 +129,16 @@ func (c *RepoCache) ReadConfigs(keyPrefix string) (map[string]string, error) { return c.repo.ReadConfigs(keyPrefix) } +// ReadConfigBool read a single boolean value from the config +func (c *RepoCache) ReadConfigBool(key string) (bool, error) { + return c.repo.ReadConfigBool(key) +} + +// ReadConfigBool read a single string value from the config +func (c *RepoCache) ReadConfigString(key string) (string, error) { + return c.repo.ReadConfigString(key) +} + // RmConfigs remove all key/value pair matching the key prefix func (c *RepoCache) RmConfigs(keyPrefix string) error { return c.repo.RmConfigs(keyPrefix) |