func getToken(db *pg.Session, key string) (*Model, error) { resetToken, err := db.FindOne(&Model{}, "key = $1", key) if err != nil { return nil, err } return resetToken.(*Model), nil }
func GetById(db *pg.Session, id int64) (*Model, error) { user, err := db.FindOne(&Model{}, "id = $1", id) if err != nil { return nil, err } return user.(*Model), nil }
func GetByEmail(db *pg.Session, email string) (*Model, error) { user, err := db.FindOne(&Model{}, "email = $1", email) if err != nil { return nil, err } return user.(*Model), nil }
func GetById(db *pg.Session, id int) (*Model, error) { entity, err := db.FindOne(&Model{}, "id=$1", id) if err != nil { return nil, err } return entity.(*Model), nil }