user

package
v0.0.0-...-0047f8d Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserParams

type CreateUserParams struct {
	Username string
	Mobile   string
	Email    string
	Password []byte
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GrpcstudyUser

type GrpcstudyUser struct {
	ID uint32
	// 用户名
	Username string
	// 手机号
	Mobile string
	// 邮箱
	Email string
	// 添加时间
	CreatedAt time.Time
	// 更新时间
	ModifiedAt time.Time
	// 密码hash
	Password []byte
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32
	Offset int32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (sql.Result, error)

func (*Queries) GetUserById

func (q *Queries) GetUserById(ctx context.Context, id uint32) (GrpcstudyUser, error)

func (*Queries) GetUserByMobile

func (q *Queries) GetUserByMobile(ctx context.Context, mobile string) (GrpcstudyUser, error)

func (*Queries) GetUserByUsername

func (q *Queries) GetUserByUsername(ctx context.Context, username string) (GrpcstudyUser, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]GrpcstudyUser, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

Jump to

Keyboard shortcuts

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