Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-02 14:54:40 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-12-02 14:54:40 +0300
commit1a648a5093175bee5907bfc5f23e466a5349d1b5 (patch)
tree7c0974a7708941197a7af98cc13d9c7afa279ae1 /internal/source/gitlab/cache/cache.go
parent043bf9da19d09d1983e04f747b35b46ce948a479 (diff)
Integrate gitlab client with gitlab source cache
Diffstat (limited to 'internal/source/gitlab/cache/cache.go')
-rw-r--r--internal/source/gitlab/cache/cache.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/source/gitlab/cache/cache.go b/internal/source/gitlab/cache/cache.go
index cba7bbcd..b224551a 100644
--- a/internal/source/gitlab/cache/cache.go
+++ b/internal/source/gitlab/cache/cache.go
@@ -2,16 +2,18 @@ package cache
import (
"context"
+
+ "gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/api"
)
// Cache is a short and long caching mechanism for GitLab source
type Cache struct {
- client Resolver
+ client api.Client
store Store
}
// NewCache creates a new instance of Cache.
-func NewCache(client Resolver) *Cache {
+func NewCache(client api.Client) *Cache {
return &Cache{
client: client,
store: newMemStore(),
@@ -19,7 +21,7 @@ func NewCache(client Resolver) *Cache {
}
// Resolve is going to return a Lookup based on a domain name
-func (c *Cache) Resolve(ctx context.Context, domain string) *Lookup {
+func (c *Cache) Resolve(ctx context.Context, domain string) *api.Lookup {
entry := c.store.LoadOrCreate(domain)
if entry.IsUpToDate() {