package
0.49.11
Repository: https://github.com/zerogo-hub/zero-helper.git
Documentation: pkg.go.dev

# README

简述

适合读多写少的场景

特点

  • 多级数据:内存缓存(big-cache),远端缓存(redis),数据库(mysql),自定义获取(未实现)
  • 数据一致性:所有内存缓存通过pub-sub保障一致性,更新内存缓存时也同时更新远端缓存

策略

可以自由组合数据获取策略

  • 内存缓存 + 远端缓存: 本地查看排行榜,本地短暂缓存排行榜数据
  • 内存缓存 + 数据库: 用于本地直接操作数据库时,缓存中无数据时从数据库获取
  • 内存缓存 + 自定义:用于专用数据库服务器操作数据时,缓存中无数据时使用自定义函数从数据库服务器拉取数据

目录

替换

替换内存缓存

替换数据库

自定义获取

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

New 创建一个实体管理器.
No description provided by the author

# Variables

ErrEmptyPlaceholder 数据为空.
ErrIDCantBeNull ID 不可以为空.
ErrNotFound 数据未找到.
ErrResultIdNotFound ID 未找到.
ErrResultIndexInvalid 无效索引.
ErrTimeout 超时.

# Structs

Results 查询结果.
Stat 统计.
No description provided by the author

# Interfaces

Entity 实体.
WrapCache 封装缓存.
WrapReadDB 封装读数据库.
WrapWriteDB 封装写数据库.

# Type aliases

DeleteHandler 删除函数.
QueryHandler 查询函数.
StatHandler 统计处理函数.
UpdateHandler 更新函数.