database

package
v0.0.0-...-8fe8001 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConnectionConfiguration is the connection configuration for connecting to database
	ConnectionConfiguration pgx.ConnConfig
	// ConnectionPoolConfiguration is the connection configuration for connecting to database
	ConnectionPoolConfiguration pgx.ConnPoolConfig
	// ConnectionPool is connection pool for database
	ConnectionPool *pgx.ConnPool
)

Functions

func UserWithEmailAddressExists

func UserWithEmailAddressExists(emailAddress *mail.Address) bool

UserWithEmailAddressExists checks if a user already exists with the specified email address

Types

type User

type User struct {
	ID           uint64
	EmailAddress string
}

User represents an application user

func CreateUser

func CreateUser(emailAddress *mail.Address) User

CreateUser adds an application user to the database

func GetUserByEmailAddress

func GetUserByEmailAddress(emailAddress *mail.Address) User

GetUserByEmailAddress returns a user for a given input email address

func GetUserByID

func GetUserByID(id uint64) User

GetUserByID gets a User by it's id

Jump to

Keyboard shortcuts

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