Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

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)

Source Files