aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/feed/cache/cache.go6
-rw-r--r--internal/feed/cache/cache_v1.go9
2 files changed, 10 insertions, 5 deletions
diff --git a/internal/feed/cache/cache.go b/internal/feed/cache/cache.go
index e69e8f3..3a80df1 100644
--- a/internal/feed/cache/cache.go
+++ b/internal/feed/cache/cache.go
@@ -18,12 +18,12 @@ import (
type Version byte
const (
- currentVersion Version = 1
+ currentVersion Version = v1Version
)
type Impl interface {
cachedFeed(*feed.Feed) CachedFeed
- transformToCurrent() (Impl, error)
+ transformTo(Version) (Impl, error)
Version() Version
Info() string
SpecificInfo(interface{}) string
@@ -169,7 +169,7 @@ func Load(fileName string) (Cache, error) {
return Cache{}, fmt.Errorf("decoding for version '%d' from '%s': %w", version, fileName, err)
}
- if cache, err = cache.transformToCurrent(); err != nil {
+ if cache, err = cache.transformTo(currentVersion); err != nil {
return Cache{}, fmt.Errorf("cannot transform from version %d to %d: %w", version, currentVersion, err)
}
diff --git a/internal/feed/cache/cache_v1.go b/internal/feed/cache/cache_v1.go
index cef26f6..7d95d4c 100644
--- a/internal/feed/cache/cache_v1.go
+++ b/internal/feed/cache/cache_v1.go
@@ -175,8 +175,13 @@ func newV1Cache() *v1Cache {
return &cache
}
-func (cache *v1Cache) transformToCurrent() (Impl, error) {
- return cache, nil
+func (cache *v1Cache) transformTo(v Version) (Impl, error) {
+ switch v {
+ case v1Version:
+ return cache, nil
+ default:
+ return nil, fmt.Errorf("Transformation not supported")
+ }
}
func (cache *v1Cache) getItem(id feedId) *cachedFeed {
-11improved performance by caching the use_expand queriesRené 'Necoro' Neumann1-5/+14 2008-03-11use catapult varsRené 'Necoro' Neumann2-4/+6 2008-03-11Updated catapult stuffRené 'Necoro' Neumann5-56/+108 2008-03-10Generate correct KeyNotFoundExceptionRené 'Necoro' Neumann1-2/+2 2008-03-09Small changesRené 'Necoro' Neumann3-1/+4 2008-03-07Better session handlingRené 'Necoro' Neumann1-5/+54 2008-03-07Small changesRené 'Necoro' Neumann1-1/+4 2008-03-07Updated shm module to 1.2René 'Necoro' Neumann1-8/+21 2008-03-07Update TODORené 'Necoro' Neumann1-3/+1 2008-03-07hmm ... yesRené 'Necoro' Neumann1-1/+1 2008-03-06Used better exceptions for configuration parserRené 'Necoro' Neumann1-26/+114 2008-03-06Update translationRené 'Necoro' Neumann2-349/+393 2008-03-06Update createpot.shRené 'Necoro' Neumann1-3/+2 2008-03-06Use 'nofork' instead of 'nolistener'René 'Necoro' Neumann1-3/+3 2008-03-05Install glade files into template dir and not data dirRené 'Necoro' Neumann2-2/+1 2008-03-05Added dependency listRené 'Necoro' Neumann3-117/+237