store

package
v0.0.0-...-71c8b1b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// 全局变量,方便其它包直接调用已初始化好的 S 实例.
	S *datastore
)

Functions

func NewStore

func NewStore(db *gorm.DB) *datastore

NewStore 创建一个 IStore 类型的实例.

Types

type IStore

type IStore interface {
	Users() UserStore
}

IStore 定义了 Store 层需要实现的方法.

type UserStore

type UserStore interface {
	Create(ctx context.Context, user *model.UserM) error
	Get(ctx context.Context, username string) (*model.UserM, error)
	Update(ctx context.Context, user *model.UserM) error
}

UserStore 定义了 user 模块在 store 层所实现的方法.

Jump to

Keyboard shortcuts

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