db

package
v0.0.0-...-9bdafd8 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 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
	Password string
}

func QueryUserByID

func QueryUserByID(ctx context.Context, userID int64) ([]*User, error)

QueryUserByID query list of user info

func QueryUserByName

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

QueryUserByName 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