diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-12-14 16:28:58 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-12-14 16:31:32 +0300 |
commit | e3c8677987d96d95bd4e012761b3367c0e173351 (patch) | |
tree | 06a4fdd9d3c6ac0039c13d8849527205ce41e2ed /internal/source/gitlab/cache/cache.go | |
parent | 3ae2f4c7bb3e28f213ee54d33dbf6fd370277996 (diff) |
Introduce API Resolver to make it easier to use caching
Diffstat (limited to 'internal/source/gitlab/cache/cache.go')
-rw-r--r-- | internal/source/gitlab/cache/cache.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/source/gitlab/cache/cache.go b/internal/source/gitlab/cache/cache.go index 7bf755a3..492a52a9 100644 --- a/internal/source/gitlab/cache/cache.go +++ b/internal/source/gitlab/cache/cache.go @@ -20,7 +20,7 @@ func NewCache(client api.Client) *Cache { } } -// GetLookup is going to return a lookup based on a domain name. The caching +// Resolve is going to return a lookup based on a domain name. The caching // algorithm works as follows: // - We first check if the cache entry exists, and if it is up-to-date. If it // is fresh we return the lookup entry from cache and it is a cache hit. @@ -69,7 +69,7 @@ func NewCache(client api.Client) *Cache { // - we create a lookup that contains information about an error // - we cache this response // - we pass this lookup upstream to all the clients -func (c *Cache) GetLookup(ctx context.Context, domain string) *api.Lookup { +func (c *Cache) Resolve(ctx context.Context, domain string) *api.Lookup { entry := c.store.LoadOrCreate(domain) if entry.IsUpToDate() { |