Documentation
¶
Index ¶
Constants ¶
View Source
const CountEmail = `
SELECT
COUNT(email)
FROM
users
WHERE
email = :email
`
View Source
const CreateProfilNotPregnant = `` /* 287-byte string literal not displayed */
View Source
const CreateProfilPregnant = `` /* 230-byte string literal not displayed */
View Source
const CreateUser = `` /* 182-byte string literal not displayed */
View Source
const GetAllProfilesByUserId = `
SELECT
id,
user_id,
profile_name,
is_pregnant
FROM
user_profiles
WHERE
user_id = :user_id`
View Source
const GetNonPregnantProfileById = `
SELECT
id,
profile_name,
is_pregnant,
user_id,
birth_date,
height,
weight
FROM
user_profiles
WHERE
id = :id`
View Source
const GetPregnantProfileById = `
SELECT
id,
profile_name,
is_pregnant,
user_id,
pregnant_date
FROM
user_profiles
WHERE
id = :id`
View Source
const GetUserByEmail = `
SELECT
id,
full_name,
email,
date_of_birth
FROM
users
WHERE
email = :email`
View Source
const GetUserById = `
SELECT
id,
full_name,
email,
date_of_birth,
role_id
FROM
users
WHERE
id = :id`
Variables ¶
View Source
var (
ErrorExecContext = NewError.New("Something when wrong when exec context", http.StatusInternalServerError)
)
Functions ¶
This section is empty.
Types ¶
type UserRepository ¶
type UserRepository interface {
Save(ctx context.Context, user domain.User) error
FindUserByEmail(ctx context.Context, email string) (domain.User, error)
CountEmail(ctx context.Context, email string) (int, error)
FindUserById(ctx context.Context, id string) (domain.User, error)
FindAllUserProfiles(ctx context.Context, userId string) ([]domain.UserProfile, error)
FindPregnantProfileById(ctx context.Context, id string) (domain.PregnantProfile, error)
FindNonPregnantProfileById(ctx context.Context, id string) (domain.NotPregnantProfile, error)
SaveUserPregnantProfile(ctx context.Context, profile domain.PregnantProfile) error
SaveUserNotPregnantProfile(ctx context.Context, profile domain.NotPregnantProfile) error
}
func New ¶
func New(db *sqlx.DB) UserRepository
Click to show internal directories.
Click to hide internal directories.