models

package
v0.0.0-...-6a62363 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserRepo

type IUserRepo interface {
	GetUserByName(ctx context.Context, name string) (*User, error)
}

IUserRepo return a user object by given query string

func NewUserRepository

func NewUserRepository(DB *gorm.DB) IUserRepo

NewUserRepository presents a repository for users.

type User

type User struct {
	global.COMMODEL
	Name   string `gorm:"index:idx_name" json:"name"`
	Gender string `json:"gender"`
	Age    int    `json:"age"`
}

User represents a user.

Jump to

Keyboard shortcuts

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