github.com/songzhibin97/gkit@v1.2.13/cache/local_cache/err.go (about) 1 package local_cache 2 3 import "errors" 4 5 var ( 6 CacheExist = errors.New("local_cache: cache exist") 7 CacheNoExist = errors.New("local_cache: cache no exist") 8 CacheExpire = errors.New("local_cache: cache expire") 9 CacheTypeErr = errors.New("local_cache: cache incr type err") 10 CacheGobErr = errors.New("local_cache: cache save gob err") 11 ) 12 13 func CacheErrExist(e error) bool { 14 return errors.Is(e, CacheExist) 15 } 16 17 func CacheErrNoExist(e error) bool { 18 return errors.Is(e, CacheNoExist) 19 } 20 21 func CacheErrExpire(e error) bool { 22 return errors.Is(e, CacheExpire) 23 } 24 25 func CacheErrTypeErr(e error) bool { 26 return errors.Is(e, CacheTypeErr) 27 }