Back to godoc.org

Package database

v0.0.0-...-67bc565
Latest Go to latest

The latest major version is .

Published: Sep 5, 2020 | License: MIT | Module: github.com/JohnnyS318/RoyalAfgInGo

Index

func IsDup

func IsDup(err error) bool

IsDup returns whether err informs of a duplicate key error because a primary key index or a secondary unique index already has an entry with the given value.

type UserDatabase

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

func NewUserDatabase

func NewUserDatabase(logger *zap.SugaredLogger) *UserDatabase

func (*UserDatabase) CreateUser

func (db *UserDatabase) CreateUser(user *models.User) error

func (*UserDatabase) DeleteUser

func (db *UserDatabase) DeleteUser(user *models.User) error

func (*UserDatabase) FindByEmail

func (db *UserDatabase) FindByEmail(email string) (*models.User, error)

func (*UserDatabase) FindById

func (db *UserDatabase) FindById(id string) (*models.User, error)

func (*UserDatabase) FindByUsername

func (db *UserDatabase) FindByUsername(username string) (*models.User, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier