repository

package
v0.0.0-...-d140a6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectMySQL

func ConnectMySQL() (err error)

ConnectMySQL 连接MySQL数据库*/

func ConnectRedis

func ConnectRedis() (err error)

func GetMySQL

func GetMySQL() *gorm.DB

GetMySQL 获取MySQL数据库句柄 */

func GetRedis

func GetRedis() *redis.Client

GetRedis 获取Redis连接句柄 */

Types

type Repository

type Repository struct {
}

func (*Repository) ConditionUpdate

func (Repository *Repository) ConditionUpdate(column string, value interface{}, query interface{}, args ...interface{}) *gorm.DB

ConditionUpdate 根据条件修改数据 */

func (*Repository) Delete

func (Repository *Repository) Delete(value interface{}, conditions ...interface{}) *gorm.DB

Delete 删除数据 */

func (*Repository) Find

func (Repository *Repository) Find(dest interface{}, conditions ...interface{}) *gorm.DB

Find 查询数据集合 */

func (*Repository) First

func (Repository *Repository) First(dest interface{}, conditions ...interface{}) *gorm.DB

First 查询一条数据 */

func (*Repository) ModelUpdate

func (Repository *Repository) ModelUpdate(model interface{}, column string, value interface{}) *gorm.DB

ModelUpdate 根据模型条件修改数据 */

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL