dao

package
v0.0.0-...-f79bcc6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao interface {
	Close()
	CreateUser(ctx context.Context, user *model.User) error
	QueryUser(ctx context.Context, cond *model.User) (*model.User, error)
}

func New

func New(dbConn *db.DbCtx, redisConn *redis.Client) (Dao, func(), error)

New 返回抽象的接口

type SampleDao

type SampleDao struct {
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(dbConn *db.DbCtx, redisConn *redis.Client) (*SampleDao, func(), error)

NewInstance 返回实例

func (*SampleDao) Close

func (d *SampleDao) Close()

func (*SampleDao) ConvertDuplicateKeyError

func (d *SampleDao) ConvertDuplicateKeyError(errCode pbBasev1.ERR_CODE, err error) (ne error)

func (*SampleDao) ConvertNotFoundError

func (d *SampleDao) ConvertNotFoundError(errCode pbBasev1.ERR_CODE, err error) (ne error)

func (*SampleDao) CreateUser

func (d *SampleDao) CreateUser(ctx context.Context, user *model.User) (err error)

func (*SampleDao) IsDuplicateKey

func (d *SampleDao) IsDuplicateKey(err error) bool

func (*SampleDao) IsNotFoundError

func (d *SampleDao) IsNotFoundError(err error) bool

func (*SampleDao) MockNotFoundError

func (d *SampleDao) MockNotFoundError() error

func (*SampleDao) QueryUser

func (d *SampleDao) QueryUser(ctx context.Context, cond *model.User) (user *model.User, err error)

Jump to

Keyboard shortcuts

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