Documentation
¶
Index ¶
- Constants
- Variables
- func ContainString(target string, slice []string) bool
- func GenInstanceId() string
- func GenPrimaryCacheKey(instanceId string, tableName string, primaryKey string) string
- func GenPrimaryCachePrefix(instanceId string, tableName string) string
- func GenSearchCacheKey(instanceId string, tableName string, sql string, vars ...interface{}) string
- func GenSearchCachePrefix(instanceId string, tableName string) string
- func GenSingleFlightKey(tableName string, sql string, vars ...interface{}) string
- func RandFloatingInt64(v int64) int64
- func ShouldCache(tableName string, tables []string) bool
- type DefaultLogger
- type Kv
- type LoggerInterface
Constants ¶
View Source
const (
GormCachePrefix = "gormcache"
)
Variables ¶
View Source
var ErrCacheLoadFailed = errors.New("cache hit, but load value error")
View Source
var ErrCacheUnmarshal = errors.New("cache hit, but unmarshal error")
View Source
var PrimaryCacheHit = errors.New("primary cache hit")
View Source
var RecordNotFoundCacheHit = errors.New("record not found cache hit")
View Source
var SearchCacheHit = errors.New("search cache hit")
View Source
var SingleFlightHit = errors.New("single flight hit")
Functions ¶
func ContainString ¶
func GenInstanceId ¶
func GenInstanceId() string
func GenPrimaryCacheKey ¶
func GenPrimaryCachePrefix ¶
func GenSearchCacheKey ¶
func GenSearchCachePrefix ¶
func GenSingleFlightKey ¶
func RandFloatingInt64 ¶
func ShouldCache ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
func (*DefaultLogger) CtxError ¶
func (l *DefaultLogger) CtxError(ctx context.Context, format string, v ...interface{})
func (*DefaultLogger) CtxInfo ¶
func (l *DefaultLogger) CtxInfo(ctx context.Context, format string, v ...interface{})
func (*DefaultLogger) SetIsDebug ¶
func (l *DefaultLogger) SetIsDebug(d bool)
Click to show internal directories.
Click to hide internal directories.