From 9adc7d4cb93db22b39f1b952f2b82b72323050db Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Fri, 23 Apr 2021 11:56:41 +0800 Subject: [PATCH] fix comment function names (#649) --- core/stores/cache/cachenode.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/stores/cache/cachenode.go b/core/stores/cache/cachenode.go index 2cf8a609..779f7c3e 100644 --- a/core/stores/cache/cachenode.go +++ b/core/stores/cache/cachenode.go @@ -59,7 +59,7 @@ func NewNode(rds *redis.Redis, barrier syncx.SharedCalls, st *Stat, } } -// DelCache deletes cached values with keys. +// Del deletes cached values with keys. func (c cacheNode) Del(keys ...string) error { if len(keys) == 0 { return nil @@ -73,7 +73,7 @@ func (c cacheNode) Del(keys ...string) error { return nil } -// GetCache gets the cache with key and fills into v. +// Get gets the cache with key and fills into v. func (c cacheNode) Get(key string, v interface{}) error { err := c.doGetCache(key, v) if err == errPlaceholder { @@ -88,12 +88,12 @@ func (c cacheNode) IsNotFound(err error) bool { return err == c.errNotFound } -// SetCache sets the cache with key and v, using c.expiry. +// Set sets the cache with key and v, using c.expiry. func (c cacheNode) Set(key string, v interface{}) error { return c.SetWithExpire(key, v, c.aroundDuration(c.expiry)) } -// SetCacheWithExpire sets the cache with key and v, using given expire. +// SetWithExpire sets the cache with key and v, using given expire. func (c cacheNode) SetWithExpire(key string, v interface{}, expire time.Duration) error { data, err := jsonx.Marshal(v) if err != nil { @@ -108,7 +108,7 @@ func (c cacheNode) String() string { return c.rds.Addr } -// TakeWithExpire takes the result from cache first, if not found, +// Take takes the result from cache first, if not found, // query from DB and set cache using c.expiry, then return the result. func (c cacheNode) Take(v interface{}, key string, query func(v interface{}) error) error { return c.doTake(v, key, query, func(v interface{}) error {