Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTenantTable ¶
func CreateTenantTable(dropExistingTable bool)
*
- Function will create the `tenants` table in the database.
func CreateUserTable ¶
func CreateUserTable(dropExistingTable bool)
*
- Function will create the `users` table in the database.
Types ¶
type Tenant ¶
type Tenant struct { Id uint64 `db:"id"` Schema sql.NullString `db:"schema"` Name sql.NullString `db:"name"` }
func CreateTenant ¶
*
- Function will create a tenant, if validation passess, and reutrns the `tenant`
- struct else returns the error.
func FindTenantById ¶
*
- Function will return the `tenant` struct if it exists in the database or
- return an error.
func FindTenantBySchema ¶
*
- Function will return the `tenant` struct if it exists in the database or
- return an error.
type User ¶
type User struct { TenantId int64 `db:"tenant_id"` TenantSchema sql.NullString `db:"tenant_schema"` Id int64 `db:"id"` FirstName sql.NullString `db:"first_name"` LastName sql.NullString `db:"last_name"` PasswordHash sql.NullString `db:"password_hash"` Email sql.NullString `db:"email"` GroupId uint8 `db:"group_id"` }
func CreateUser ¶
func CreateUser(email string, firstName string, lastName string, password string, tenantId int64, tenantSchema string, groupId int64) (*User, error)
*
- Function will create a user, if validation passess, and reutrns the `user`
- struct else returns the error.
func FindUserByEmail ¶
*
- Function will return the `user` struct if it exists in the database or
- return an error.
Click to show internal directories.
Click to hide internal directories.