db

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

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

Go to latest
Published: Feb 29, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	Id          uuid.UUID `gorm:"primaryKey;type:uuid"`
	Name        string    `gorm:"not null;default:'unknown'"`
	Email       string    `gorm:"not null;unique"`
	Phone       string    `gorm:"unique"`
	Deactivated bool
	AuthId      uuid.UUID `gorm:"uniqueIndex:authid_unique,where:deleted_at is null;not null;type:uuid"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   gorm.DeletedAt `gorm:"index"`
}

type UserRepo

type UserRepo interface {
	Add(user *User, nestedFunc func(*User, *gorm.DB) error) error
	Get(id uuid.UUID) (*User, error)
	GetByAuthId(id uuid.UUID) (*User, error)
	Update(user *User, nestedFunc func(*User, *gorm.DB) error) error
	Delete(id uuid.UUID, nestedFunc func(uuid.UUID, *gorm.DB) error) error
	GetUserCount() (int64, int64, error)
	GetByEmail(email string) (*User, error)
}

func NewUserRepo

func NewUserRepo(db sql.Db) UserRepo

Jump to

Keyboard shortcuts

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