package
0.0.0-20231103123238-49bf83314d38
Repository: https://github.com/daz-3ux/dblog.git
Documentation: pkg.go.dev
# README
store layer
- 仓库层
开发流程
使用单例工厂模式
- 创建一个结构体: 用来创建 store 层实例
- store 建立在
*gorm.DB
之上
- store 建立在
- 创建一个 New 函数: 初始化 store 层实例
- 创建一个包级别的 store 层变量: 为了方便调用 store 层实例
S *datastore
- 创建一个 sync.Once 变量: 为了避免实例被多次创建,
once sync.Once