orm

package
v0.0.0-...-b8bafe8 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

func NewUserRepository

func NewUserRepository(db *gorm.DB) user.Repository

Types

type User

type User struct {
	gorm.Model
	Name     string `json:"name" gorm:"Index;not null;size:32"`
	Email    string `json:"email" gorm:"uniqueIndex;not null;size:64"`
	Password string `json:"password" gorm:"not null"`
}

type UserRepository

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

func (*UserRepository) Create

func (r *UserRepository) Create(ctx context.Context, userEnt *user.User) error

func (*UserRepository) GetByEmail

func (r *UserRepository) GetByEmail(ctx context.Context, email string) (*user.User, error)

func (*UserRepository) GetById

func (r *UserRepository) GetById(ctx context.Context, id uint) (*user.User, error)

Jump to

Keyboard shortcuts

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