Documentation ¶
Index ¶
- type ContactRepo
- type UserRepo
- func (r *UserRepo) CountUsers() (int, error)
- func (r *UserRepo) CreateAuthenticationToken(id string) (*models.AuthenticationToken, error)
- func (r *UserRepo) CreateLoginToken(username string) (*models.RegistrationToken, error)
- func (r *UserRepo) CreateRegistrationToken() (*models.RegistrationToken, error)
- func (r *UserRepo) FindAccountPublicKey(id string) (string, error)
- func (r *UserRepo) FindEncryptedAccount(username string) (*models.User, error)
- func (r *UserRepo) FindRegistrationToken(id string) (*models.RegistrationToken, error)
- func (r *UserRepo) InsertAccount(user models.User) (string, error)
- func (r *UserRepo) SearchIdByUsername(username string) (string, error)
- func (r *UserRepo) UsernameExists(username string) (bool, error)
- func (r *UserRepo) VerifyAccountPIN(username string, pin string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContactRepo ¶
type ContactRepo struct {
// contains filtered or unexported fields
}
func NewContactRepo ¶
func NewContactRepo(db *sql.DB) *ContactRepo
func (*ContactRepo) DeleteContact ¶
func (c *ContactRepo) DeleteContact(id string, contactId string) error
Delete an individual contact from a user account
func (*ContactRepo) FetchAllContacts ¶
func (c *ContactRepo) FetchAllContacts(id string) ([]*models.Contact, error)
Fetch all contacts for a user ID
func (*ContactRepo) NewContact ¶
func (c *ContactRepo) NewContact(contact models.Contact) (string, error)
Insert new contact to database
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func NewUserRepo ¶
func (*UserRepo) CountUsers ¶
Count the number of users on the platform
func (*UserRepo) CreateAuthenticationToken ¶
func (r *UserRepo) CreateAuthenticationToken(id string) (*models.AuthenticationToken, error)
Create session token
func (*UserRepo) CreateLoginToken ¶
func (r *UserRepo) CreateLoginToken(username string) (*models.RegistrationToken, error)
Create ephemeral login token and add to Redis cache
func (*UserRepo) CreateRegistrationToken ¶
func (r *UserRepo) CreateRegistrationToken() (*models.RegistrationToken, error)
Create ephemeral registration token and add to Redis cache
func (*UserRepo) FindAccountPublicKey ¶
Find account public key by its ID
func (*UserRepo) FindEncryptedAccount ¶
Fetch the encrypted blob for a user account
func (*UserRepo) FindRegistrationToken ¶
func (r *UserRepo) FindRegistrationToken(id string) (*models.RegistrationToken, error)
Lookup a registration token based on its ID and return it
func (*UserRepo) InsertAccount ¶
Insert an account to the database
func (*UserRepo) SearchIdByUsername ¶
Search for a users ID from their username
func (*UserRepo) UsernameExists ¶
Check if username already exists in database
Click to show internal directories.
Click to hide internal directories.