db

package
v0.0.0-...-2486f02 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func CreateUser

func CreateUser(ctx context.Context, users []*User) error

CreateUser create user info

func Init

func Init()

Init init DB

Types

type User

type User struct {
	gorm.Model
	Username string `json:"username"`
	Password string `json:"password"`
}

func MGetUsers

func MGetUsers(ctx context.Context, userIDs []int64) ([]*User, error)

MGetUsers multiple get list of user info

func QueryUser

func QueryUser(ctx context.Context, userName string) ([]*User, error)

QueryUser query list of user info

func (*User) TableName

func (u *User) TableName() string

Jump to

Keyboard shortcuts

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