repository

package
v0.0.0-...-64c63ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 NewUserRepo(db *sql.DB, rdb *redis.Client) *UserRepo

func (*UserRepo) CountUsers

func (r *UserRepo) CountUsers() (int, error)

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

func (r *UserRepo) FindAccountPublicKey(id string) (string, error)

Find account public key by its ID

func (*UserRepo) FindEncryptedAccount

func (r *UserRepo) FindEncryptedAccount(username string) (*models.User, error)

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

func (r *UserRepo) InsertAccount(user models.User) (string, error)

Insert an account to the database

func (*UserRepo) SearchIdByUsername

func (r *UserRepo) SearchIdByUsername(username string) (string, error)

Search for a users ID from their username

func (*UserRepo) UsernameExists

func (r *UserRepo) UsernameExists(username string) (bool, error)

Check if username already exists in database

func (*UserRepo) VerifyAccountPIN

func (r *UserRepo) VerifyAccountPIN(username string, pin string) (bool, error)

Verify and validate an accounts PIN

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL