Skip to content

Commit

Permalink
refactor: 独立 cache
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Nov 23, 2023
1 parent 886e66c commit c3d1298
Show file tree
Hide file tree
Showing 29 changed files with 70 additions and 1,080 deletions.
56 changes: 0 additions & 56 deletions .github/workflows/cache.yml

This file was deleted.

10 changes: 5 additions & 5 deletions app/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"strings"
"time"

"github.com/issue9/cache"
"github.com/issue9/scheduled"

"github.com/issue9/web"
"github.com/issue9/web/cache"
"github.com/issue9/web/cache/caches"
"github.com/issue9/web/locales"
"github.com/issue9/web/server"
)

var cacheFactory = map[string]CacheBuilder{}
Expand Down Expand Up @@ -91,16 +91,16 @@ func init() {
return nil, nil, err
}

drv, job := caches.NewMemory()
drv, job := server.NewMemory()
return drv, &Job{Ticker: d, Job: job}, nil
}, "", "memory")

RegisterCache(func(dsn string) (cache.Driver, *Job, error) {
return caches.NewMemcache(strings.Split(dsn, ";")...), nil, nil
return server.NewMemcache(strings.Split(dsn, ";")...), nil, nil
}, "memcached", "memcache")

RegisterCache(func(dsn string) (cache.Driver, *Job, error) {
drv, err := caches.NewRedisFromURL(dsn)
drv, err := server.NewRedisFromURL(dsn)
if err != nil {
return nil, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"runtime/debug"
"time"

"github.com/issue9/cache"
"github.com/issue9/config"
"golang.org/x/text/language"

"github.com/issue9/web"
"github.com/issue9/web/cache"
"github.com/issue9/web/locales"
"github.com/issue9/web/logs"
"github.com/issue9/web/server"
Expand Down
112 changes: 0 additions & 112 deletions cache/cache.go

This file was deleted.

3 changes: 0 additions & 3 deletions cache/caches/README.md

This file was deleted.

39 changes: 0 additions & 39 deletions cache/caches/caches.go

This file was deleted.

Loading

0 comments on commit c3d1298

Please sign in to comment.