Documentation
¶
Index ¶
- Variables
- func CreateProduct(name string, public bool, users models.ProductUsers, ...) (*models.Product, error)
- func CreateUser(name string, email string, passwd []byte, ...) (*models.User, error)
- func DeleteUser(ID *uuid.UUID, nominatedOwners map[uuid.UUID]uuid.UUID) error
- type DBConnectorMock
- type DBFunctionInterfaceMock
- func (i DBFunctionInterfaceMock) AddAsset(assetType string, asset *models.Asset, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) AddProduct(product *models.Product, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) AddProductUsers(productID *uuid.UUID, productUsers models.ProductUsers, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) AddUser(user *models.User, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) DeleteAsset(assetType string, assetID *uuid.UUID, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) DeleteProduct(productID *uuid.UUID, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) DeleteProductUsersByProductID(productID *uuid.UUID, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) DeleteUser(userID *uuid.UUID, tx *sql.Tx) error
- func (i DBFunctionInterfaceMock) GetPrivileges() (models.Privileges, error)
- func (i DBFunctionInterfaceMock) GetProductByID(ID uuid.UUID, tx *sql.Tx) (*models.Product, error)
- func (i DBFunctionInterfaceMock) GetProductByName(name string, tx *sql.Tx) (*models.Product, error)
- func (i DBFunctionInterfaceMock) GetProductsByUserID(userID uuid.UUID) ([]models.Product, error)
- func (i DBFunctionInterfaceMock) GetUser(queryString string, keyValue interface{}, tx *sql.Tx) (*models.User, error)
- func (i DBFunctionInterfaceMock) GetUserProductIDs(userID uuid.UUID, tx *sql.Tx) (*models.UserProducts, error)
- func (i DBFunctionInterfaceMock) UpdateUsersProducts(userID *uuid.UUID, productID *uuid.UUID, privilege int, tx *sql.Tx) error
- type ModelInterfaceMock
- func (i ModelInterfaceMock) NewAsset(references models.DataMap, generatePath func(assetID *uuid.UUID) string) (*models.Asset, error)
- func (i ModelInterfaceMock) NewProduct(name string, public bool, detailsID *uuid.UUID, assetsID *uuid.UUID) (*models.Product, error)
- func (i ModelInterfaceMock) NewUser(name string, email string, password []byte, settingsID uuid.UUID, ...) (*models.User, error)
- type ProjectDBCommon
- type ProjectDBDummy
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicateEmailEntry = errors.New("User with this email already exists")
View Source
var ErrEmptyUsersList = errors.New("At least one product user is required")
View Source
var ErrInvalidOwnerCount = errors.New("Product must have a single owner")
View Source
var ErrProductExistsString = "Product with name %s already exists"
View Source
var ErrUnknownPrivilegeString = "Unknown privilege %d set for user %s"
View Source
var ErrUserNotFound = errors.New("The selected user not found")
Functions ¶
func CreateProduct ¶
func CreateUser ¶
Types ¶
type DBConnectorMock ¶
type DBConnectorMock struct {
// contains filtered or unexported fields
}
DBConnectorMock overwrites the mysqldb package implementations for DB connectionwith mock code.
func (DBConnectorMock) BootstrapSystem ¶
func (i DBConnectorMock) BootstrapSystem() error
func (DBConnectorMock) ConnectSystem ¶
func (i DBConnectorMock) ConnectSystem() (*sql.Tx, error)
type DBFunctionInterfaceMock ¶
type DBFunctionInterfaceMock struct {
// contains filtered or unexported fields
}
DBFunctionInterfaceMock overwrites the mysqldb package function implementations with mock code.
func (DBFunctionInterfaceMock) AddProduct ¶
func (DBFunctionInterfaceMock) AddProductUsers ¶
func (i DBFunctionInterfaceMock) AddProductUsers(productID *uuid.UUID, productUsers models.ProductUsers, tx *sql.Tx) error
func (DBFunctionInterfaceMock) DeleteAsset ¶
func (DBFunctionInterfaceMock) DeleteProduct ¶
func (DBFunctionInterfaceMock) DeleteProductUsersByProductID ¶
func (DBFunctionInterfaceMock) DeleteUser ¶
func (DBFunctionInterfaceMock) GetPrivileges ¶
func (i DBFunctionInterfaceMock) GetPrivileges() (models.Privileges, error)
func (DBFunctionInterfaceMock) GetProductByID ¶
func (DBFunctionInterfaceMock) GetProductByName ¶
func (DBFunctionInterfaceMock) GetProductsByUserID ¶
func (DBFunctionInterfaceMock) GetUserProductIDs ¶
func (i DBFunctionInterfaceMock) GetUserProductIDs(userID uuid.UUID, tx *sql.Tx) (*models.UserProducts, error)
type ModelInterfaceMock ¶
type ModelInterfaceMock struct {
// contains filtered or unexported fields
}
ModelInterfaceMock overwrites the models package implementations with mock code.
func (ModelInterfaceMock) NewProduct ¶
type ProjectDBCommon ¶
type ProjectDBDummy ¶
type ProjectDBDummy struct { }
ProjectDBDummy is a dummy implementation of ProjectDB interface. Since project handling can be completely decoupled from user/product management It is up to the user what implementation he/she invokes.
func (ProjectDBDummy) DeleteProjects ¶
func (ProjectDBDummy) DeleteProjects(productID uuid.UUID) error
Click to show internal directories.
Click to hide internal directories.