dao

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DBconffile = "mysql.yml"
	DSN        = "user:password@/dbname"

	RDconffile = "redis.yml"
	ADDR       = "127.0.0.1:6379"
)

Functions

This section is empty.

Types

type CCConfig added in v1.0.1

type CCConfig struct {
	Name string
	Addr string `yaml:"addr"`
}

type DBConfig

type DBConfig struct {
	DSN string `yaml:"dsn"`
}

DBConfig mysql config.

type Dao

type Dao interface {
	Close()
	Ping(ctx context.Context) (err error)
	//call
	UpdatePingCount(c context.Context, t model.PingType, v model.PingCount) error
	ReadPingCount(c context.Context, t model.PingType) (model.PingCount, error)

	CreateUser(c context.Context, user *model.User) error
	UpdateUser(c context.Context, user *model.User) error
	ReadUser(c context.Context, uid int64) (model.User, error)
	DeleteUser(c context.Context, uid int64) error
	// contains filtered or unexported methods
}

Dao dao interface

func New

func New(confpath string) Dao

New new a dao.

Jump to

Keyboard shortcuts

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