Documentation
¶
Overview ¶
cache包使用示例 展示如何使用统一的工厂函数创建不同类型的缓存实例
本文件提供了完整的缓存使用示例,包括Redis、BadgerDB和BuntDB三种实现 通过实际代码演示统一接口的优势和使用方法
示例内容: - 基本键值操作:Set/Get/Delete/Exists/Expire - 队列操作:Push/Pop/LPush/RPush/LPop/RPop/PopAll/Len - 哈希表操作:HSet/HGet/HDel/HGetAll - 事务操作:BeginTx/Commit/Rollback - 驱动发现:列出所有可用驱动
演示特点: - 统一的API调用方式 - 相同的业务逻辑代码 - 灵活的驱动切换 - 完整的错误处理
运行方式:
go run example.go 或在测试中调用各个Example函数
作者: gophertool
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.