Documentation
¶
Index ¶
- Variables
- func AddAsset() (*uuid.UUID, error)
- func AddProduct(product *models.Product, productUsers *models.ProductUsers) error
- func AddProject(project models.Project) error
- func AddSettings() (*uuid.UUID, error)
- func AddUser(name string, email string, passwd string) error
- func ConvertToJSONRaw(references interface{}) (*json.RawMessage, error)
- func DeleteAsset(assetID *uuid.UUID) error
- func DeleteProduct(productID *uuid.UUID) error
- func DeleteSettings(settingsID *uuid.UUID) error
- func DeleteUser(email string) error
- func EmailExists(email string) (bool, error)
- func GetAsset(assetID *uuid.UUID) (*models.Asset, error)
- func GetProductByID(ID uuid.UUID) (*models.Product, error)
- func GetProductsByUserID(userID uuid.UUID) (*[]models.Product, error)
- func GetProjectByName(name string) (models.Project, error)
- func GetSettings(settingsID *uuid.UUID) (*models.UserSetting, error)
- func GetUserByEmail(email string) (*models.User, error)
- func GetUserByID(ID uuid.UUID) (*models.User, error)
- func IsPasswordCorrect(password string, user *models.User) bool
- func UpdateAsset(asset *models.Asset) error
- func UpdateAssetID(user *models.User) error
- func UpdateProject(project models.Project) error
- func UserExists(username string) (bool, error)
- type DBInterfaceCommon
- type DBInterfaceMock
- type MYSQLInterface
Constants ¶
This section is empty.
Variables ¶
var DBConnection = ""
var MigrationDirectory = ""
Functions ¶
func AddProduct ¶ added in v0.0.3
func AddProduct(product *models.Product, productUsers *models.ProductUsers) error
func AddProject ¶ added in v0.0.3
AddProject adds a new project to the database.
func AddSettings ¶
func AddUser ¶
AddUser creates a new user entry in the DB. Whitespaces in the email are automatically deleted Email is a unique attribute, so the function checks for existing email, before adding a new entry
func ConvertToJSONRaw ¶ added in v0.0.3
func ConvertToJSONRaw(references interface{}) (*json.RawMessage, error)
func DeleteAsset ¶ added in v0.0.3
func DeleteProduct ¶ added in v0.0.3
func DeleteSettings ¶
func DeleteUser ¶
func EmailExists ¶
func GetProductsByUserID ¶ added in v0.0.3
GetProductsByUserID returns all products belonging to the selected user. The function first gets all rows matching with the user DI from users_products table, then gets all products based on the product ids from the first query result.
func GetProjectByName ¶ added in v0.0.3
GetProjectByName returns the project by name.
func GetSettings ¶
func GetSettings(settingsID *uuid.UUID) (*models.UserSetting, error)
func GetUserByEmail ¶
GetUserByEmail returns the user defined by the email.
func GetUserByID ¶ added in v0.0.3
GetUserByID returns the user defined by it uuid.
func IsPasswordCorrect ¶ added in v0.0.3
CheckPassword compares the password entered by the user with the stored password.
func UpdateAsset ¶ added in v0.0.3
func UpdateAssetID ¶ added in v0.0.3
Adds a new assetID if there is non assigned yet. This only can happen if the user was generated before introduction of assets.
func UpdateProject ¶ added in v0.0.3
UpdateProject updates the selected project.
func UserExists ¶
Types ¶
type DBInterfaceCommon ¶ added in v0.0.3
var DBInterface DBInterfaceCommon
type DBInterfaceMock ¶ added in v0.0.3
func (DBInterfaceMock) BootstrapSystem ¶ added in v0.0.3
func (DBInterfaceMock) BootstrapSystem() error
func (DBInterfaceMock) ConnectSystem ¶ added in v0.0.3
func (i DBInterfaceMock) ConnectSystem() (*sql.DB, error)
type MYSQLInterface ¶ added in v0.0.3
type MYSQLInterface struct { }
func (MYSQLInterface) BootstrapSystem ¶ added in v0.0.3
func (MYSQLInterface) BootstrapSystem() error
func (MYSQLInterface) ConnectSystem ¶ added in v0.0.3
func (MYSQLInterface) ConnectSystem() (*sql.DB, error)