lib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MulanPSL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Gorm *gorm.DB
View Source
var NewsCachePool *sync.Pool

Functions

func NewMCache

func NewMCache() *goredis.SimpleCache

func NewsDBGetter

func NewsDBGetter(id string) goredis.DBGettFunc

func ReleaseMCache

func ReleaseMCache(cache *goredis.SimpleCache)

释放连接

Types

type McachePool

type McachePool struct {
	mstruct.MCacheConfig
}

func NewMCachePool

func NewMCachePool(config mstruct.MCacheConfig) *McachePool

func (*McachePool) SetConn

func (this *McachePool) SetConn()

设置连接信息

type NewsModel

type NewsModel struct {
	NewsID      int       `gorm:"column:id" json:"id"`
	NewsTitle   string    `gorm:"column:newstitle" json:"title"`
	NewsContent string    `gorm:"column:newscontent" json:"content"`
	NewsVies    int       `gorm:"column:views" json:"views"`
	NewsTime    time.Time `gorm:"column:addtime" json:"addtime"`
}

func NewNewsModel

func NewNewsModel() *NewsModel

Jump to

Keyboard shortcuts

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