user

package
v0.0.0-...-3a7af38 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UniqueConstraintUsername = "users_username_key"
	UniqueConstraintEmail    = "users_email_key"
)

Variables

This section is empty.

Functions

func Create

func Create(db *gorm.DB, user *User) (uint, error)

Types

type EmailDuplicateError

type EmailDuplicateError struct {
	Email string
}

func (*EmailDuplicateError) Error

func (e *EmailDuplicateError) Error() string

type EmailNotExistsError

type EmailNotExistsError struct{}

func (*EmailNotExistsError) Error

func (*EmailNotExistsError) Error() string

type User

type User struct {
	ID           uint `gorm:"primary_key"`
	Username     string
	Email        string
	PasswordHash string
}

func FindByEmail

func FindByEmail(db *gorm.DB, email string) (*User, error)

type UsernameDuplicateError

type UsernameDuplicateError struct {
	Username string
}

func (*UsernameDuplicateError) Error

func (e *UsernameDuplicateError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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