dao

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 5 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
}

func New

func New(engine *gorm.DB) *Dao

func (*Dao) CreateUser

func (d *Dao) CreateUser(username, password, nickname, profilePic string, status uint8) (*models.UserTab, error)

func (*Dao) GetUserByName

func (d *Dao) GetUserByName(username string) (models.UserTab, error)

func (*Dao) UpdateUser

func (d *Dao) UpdateUser(id uint32, nickname, profilePic string) error

type RedisCache

type RedisCache struct {
	Cache *redis.Client
}

func NewCache

func NewCache(cacheClient *redis.Client) *RedisCache

func (*RedisCache) Get

func (cache *RedisCache) Get(ctx context.Context, key string) (string, error)

func (*RedisCache) Set

func (cache *RedisCache) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

Jump to

Keyboard shortcuts

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