dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 12 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 struct {
	// contains filtered or unexported fields
}

Dao dao

func New

func New(c *conf.Config) (dao *Dao)

New init mysql db

func (*Dao) AddCacheSysMsg

func (d *Dao) AddCacheSysMsg(ctx context.Context, msg map[int64]*v1.SysMsg)

AddCacheSysMsg 添加sys_msg缓存

func (*Dao) CacheSysMsg

func (d *Dao) CacheSysMsg(ctx context.Context, ids []int64) (res map[int64]*v1.SysMsg, err error)

CacheSysMsg .

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) CreateSysMsg

func (d *Dao) CreateSysMsg(ctx context.Context, msg *v1.SysMsg) (err error)

CreateSysMsg 创建系统消息

func (*Dao) DelCacheSysMsg

func (d *Dao) DelCacheSysMsg(ctx context.Context, msgID int64)

DelCacheSysMsg 删除sys_msg缓存

func (*Dao) Ping

func (d *Dao) Ping(ctx context.Context) error

Ping dao ping

func (*Dao) RawSysMsg

func (d *Dao) RawSysMsg(ctx context.Context, ids []int64) (res map[int64]*v1.SysMsg, err error)

RawSysMsg 获取系统消息

func (*Dao) SysMsg

func (d *Dao) SysMsg(c context.Context, keys []int64) (res map[int64]*v1.SysMsg, err error)

SysMsg get data from cache if miss will call source method, then add to cache.

Jump to

Keyboard shortcuts

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