diff --git a/caches/lruCacher.go b/lru_cacher.go similarity index 99% rename from caches/lruCacher.go rename to lru_cacher.go index 3f28402b..bb223c20 100644 --- a/caches/lruCacher.go +++ b/lru_cacher.go @@ -1,5 +1,5 @@ //LRUCacher implements Cacher according to LRU algorithm -package caches +package xorm import ( "container/list" diff --git a/caches/memoryStore.go b/memroy_store.go similarity index 91% rename from caches/memoryStore.go rename to memroy_store.go index 67cfb0d4..c5800e46 100644 --- a/caches/memoryStore.go +++ b/memroy_store.go @@ -1,17 +1,12 @@ // MemoryStore implements CacheStore provide local machine -package caches +package xorm import ( - "errors" "sync" "github.com/go-xorm/core" ) -var ( - ErrNotExist = errors.New("key not exist") -) - var _ core.CacheStore = NewMemoryStore() // memory store diff --git a/xorm.go b/xorm.go index 38db6d4f..2b059a09 100644 --- a/xorm.go +++ b/xorm.go @@ -11,7 +11,6 @@ import ( "time" "github.com/go-xorm/core" - "github.com/go-xorm/xorm/caches" ) const ( @@ -95,14 +94,14 @@ func NewEngine(driverName string, dataSourceName string) (*Engine, error) { return engine, err } -func NewLRUCacher(store core.CacheStore, max int) *caches.LRUCacher { - return caches.NewLRUCacher(store, core.CacheExpired, core.CacheMaxMemory, max) +// func NewLRUCacher(store core.CacheStore, max int) *LRUCacher { +// return NewLRUCacher(store, core.CacheExpired, core.CacheMaxMemory, max) +// } + +func NewLRUCacher2(store core.CacheStore, expired time.Duration, max int) *LRUCacher { + return NewLRUCacher(store, expired, 0, max) } -func NewLRUCacher2(store core.CacheStore, expired time.Duration, max int) *caches.LRUCacher { - return caches.NewLRUCacher(store, expired, 0, max) -} - -func NewMemoryStore() *caches.MemoryStore { - return caches.NewMemoryStore() -} +// func NewMemoryStore() *MemoryStore { +// return NewMemoryStore() +// }