models

package
v0.0.0-...-569c342 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 2 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        uint      `gorm:"primaryKey" json:"id"`
	Username  string    `gorm:"uniqueIndex" json:"username"`
	Email     string    `gorm:"unique" json:"email"`
	Password  string    `json:"-"`
	Bio       string    `json:"bio"`
	CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
}

type UserOrmer

type UserOrmer interface {
	GetOneByID(id uint) (user User, err error)
	GetOneByUsername(username string) (user User, err error)
	InsertUser(user User) (id uint, err error)
	UpdateUser(user User) (err error)
}

func NewUserOrmer

func NewUserOrmer(db *gorm.DB) UserOrmer

Jump to

Keyboard shortcuts

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