Documentation ¶
Index ¶
Constants ¶
View Source
const QueryCreateContact = `
INSERT INTO contacts(name, phones, description, user_id) VALUES($1, $2, $3, $4)
RETURNING id;`
View Source
const QueryCreateUser = `
INSERT INTO users(email, password) VALUES($1, $2)
RETURNING id;`
View Source
const QueryDeleteContact = `
DELETE FROM contacts
WHERE user_id=$1 AND id=$2;`
View Source
const QueryGetContactById = `
SELECT name, phones, description
FROM contacts
WHERE user_id=$1 AND id=$2;`
View Source
const QueryGetContacts = `` /* 154-byte string literal not displayed */
View Source
const QueryGetUserByEmail = `
SELECT id, password, created_at
FROM users
WHERE email=$1;`
View Source
const QueryGetUserByEmailAndPassword = `
SELECT id, created_at
FROM users
WHERE email=$1 AND password=$2;`
View Source
const QueryGetUserDetailsById = `` /* 291-byte string literal not displayed */
View Source
const QueryUpdateContact = `
UPDATE contacts
SET name=$1, phones=$2, description=$3
WHERE user_id=$4 AND id=$5;`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Migrate(models.Migrate) error CreateUser(user *models.User) error GetUserByEmail(email string) (*models.User, error) GetUserByEmailAndPassword(email, password string) (*models.User, error) CreateContact(userId uint64, contect *models.Contact) error GetContactById(userId, contactId uint64) (*models.Contact, error) UpdateContact(userId uint64, contact *models.Contact) error DeleteContact(userId, contactId uint64) error GetContacts(userId uint64, encryptedCursor, search string, limit int) ([]models.Contact, string, error) }
Click to show internal directories.
Click to hide internal directories.