mysql

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableName = "sys_cache"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheVal

type CacheVal struct {
	Key       string    `gorm:"column:id;type:varchar(64);primaryKey"`
	Val       string    `gorm:"column:value;type:varchar(1024)"`
	ExpiredAt time.Time `gorm:"column:expired_at;type:timestamp"`
	Version   uint16    `gorm:"column:version"`
}

func (*CacheVal) TableName

func (*CacheVal) TableName() string

type MysqlCache

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

func NewCache

func NewCache(db *gorm.DB) *MysqlCache

func (*MysqlCache) Delete

func (mc *MysqlCache) Delete(key string) error

func (*MysqlCache) Get

func (mc *MysqlCache) Get(key string, val interface{}) error

func (*MysqlCache) IsExist

func (mc *MysqlCache) IsExist(key string) bool

func (*MysqlCache) Set

func (mc *MysqlCache) Set(key string, val interface{}, timeout time.Duration) error

Jump to

Keyboard shortcuts

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