Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auto_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (storage *StorageAutoCache) getEntry(key string) (*EntryAutoCache, error) {
entry, ok := storage.entries[key]
storage.lock.RUnlock()
if !ok {
err = errors.Errorf("Auto cache key %s nof found", key)
err = errors.Errorf("Auto cache key %s not found", key)
}

return entry, err
Expand Down
2 changes: 1 addition & 1 deletion auto_cache_fake.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (storage *StorageAutoCacheFake) Get(key string) (interface{}, error) {
updater, find := storage.updaters[key]
storage.mutex.RUnlock()
if !find {
return nil, errors.Errorf("Auto cache key %s nof found", key)
return nil, errors.Errorf("Auto cache key %s not found", key)
}

return updater()
Expand Down
10 changes: 5 additions & 5 deletions byte_cache_blackhole.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ func NewBlackholeCache() *BlackholeCache {
return &BlackholeCache{}
}

// Get returns nil, do nothing
// Get returns nil, does nothing
func (cache *BlackholeCache) Get(key *Key) (data []byte, ok bool) {
return
}

// Put returns nil, do nothing
// Put returns nil, does nothing
func (cache *BlackholeCache) Put(data []byte, key *Key, ttl time.Duration) {}

// ScanKeys returns nil, do nothing
// ScanKeys returns nil, does nothing
func (cache *BlackholeCache) ScanKeys(set string) ([]Key, error) {
return nil, nil
}

// Remove returns nil, do nothing
// Remove returns nil, does nothing
func (cache *BlackholeCache) Remove(key *Key) (err error) {
return
}

// Close do nothing
// Close does nothing
func (cache *BlackholeCache) Close() {}

// Flush removes all entries from cache and returns number of flushed entries
Expand Down
10 changes: 5 additions & 5 deletions byte_cache_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ func (this *wrapperCache) createRealCache(fn fnCreate) {
}
}

// Get returns nil, do nothing
// Get returns nil, does nothing
func (this *wrapperCache) Get(key *Key) ([]byte, bool) {
return this.getCache().Get(key)
}

// Put returns nil, do nothing
// Put returns nil, does nothing
func (this *wrapperCache) Put(data []byte, key *Key, ttl time.Duration) {
this.getCache().Put(data, key, ttl)
}

// ScanKeys returns nil, do nothing
// ScanKeys returns nil, does nothing
func (this *wrapperCache) ScanKeys(set string) ([]Key, error) {
return this.getCache().ScanKeys(set)
}

// Remove returns nil, do nothing
// Remove returns nil, does nothing
func (this *wrapperCache) Remove(key *Key) error {
return this.getCache().Remove(key)
}

// Close do nothing
// Close does nothing
func (this *wrapperCache) Close() {
this.doneChan <- true
this.getCache().Close()
Expand Down
2 changes: 1 addition & 1 deletion metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func SinceMs(started time.Time) float64 {
return float64(time.Since(started)) / float64(time.Millisecond)
}

// IsError is a trivial helper for minimize repetitive checks for error
// IsError is a trivial helper for minimizing repetitive checks for error
// values. It passing appropriate numbers to metrics.
func IsError(err error) string {
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions struct_cache_dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"go-cache/errors"
)

// StructCacheDummy implements cache that accept any data but always return null
// StructCacheDummy implements cache that accepts any data but always returns null
type StructCacheDummy struct {
logger IStructCacheLogger
}
Expand All @@ -26,24 +26,24 @@ func (cache *StructCacheDummy) RegisterCacheSet(setName string, limit int, ticke
return nil
}

// Close do nothing
// Close does nothing
func (cache *StructCacheDummy) Close() {
cache.logger.Debug("struct_storage_dummy: close()")
}

// GetWithTime returns nil, do nothing
// GetWithTime returns nil, does nothing
func (cache *StructCacheDummy) GetWithTime(key *Key) (data interface{}, dt time.Time, ok bool) {
cache.logger.Debugf("struct_storage_dummy: getWithTime(), key: %s", key.ID())
return
}

// Get returns nil, do nothing
// Get returns nil, does nothing
func (cache *StructCacheDummy) Get(key *Key) (data interface{}, ok bool) {
cache.logger.Debugf("struct_storage_dummy: get(), key: %s", key.ID())
return
}

// Put returns nil, do nothing
// Put returns nil, does nothing
func (cache *StructCacheDummy) Put(data interface{}, key *Key, ttl time.Duration) error {
cache.logger.Debugf("struct_storage_dummy: put(), key: %s", key.ID())
// For the beginning, let's check if it is pointer.
Expand All @@ -53,7 +53,7 @@ func (cache *StructCacheDummy) Put(data interface{}, key *Key, ttl time.Duration
return nil
}

// Remove returns nil, do nothing
// Remove returns nil, does nothing
func (cache *StructCacheDummy) Remove(key *Key) {
cache.logger.Debugf("struct_storage_dummy: remove(), key: %s", key.ID())
}
Expand Down