dao

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Provider = wire.NewSet(New, NewDB, NewRedis, NewMC)

Functions

func NewDB

func NewDB() (db *sql.DB, cf func(), err error)

func NewMC

func NewMC() (mc *memcache.Memcache, cf func(), err error)

func NewRedis

func NewRedis() (r *redis.Redis, cf func(), err error)

Types

type Dao

type Dao interface {
	Close()
	Ping(ctx context.Context) (err error)
	// bts: -nullcache=&model.Article{ID:-1} -check_null_code=$!=nil&&$.ID==-1
	Article(c context.Context, id int64) (*model.Article, error)
}

Dao dao interface

func New

func New(r *redis.Redis, mc *memcache.Memcache, db *sql.DB) (d Dao, cf func(), err error)

New new a dao and return.

Jump to

Keyboard shortcuts

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