Documentation ¶
Index ¶
- type DevicePort
- type FakeDevice
- func (f FakeDevice) CreateDevice(inventory *models.Device) (uint32, error)
- func (f FakeDevice) DeleteDevice(id uint64) error
- func (f FakeDevice) GetDevice(id uint64) (*models.Device, error)
- func (f FakeDevice) GetDevices() ([]*models.Device, error)
- func (f FakeDevice) UpdateDevice(id uint64, device *models.Device) error
- type FakeInventory
- func (f FakeInventory) CreateInventoryItem(state *models.State) error
- func (f FakeInventory) DeleteInventoryItem(id uint32) error
- func (f FakeInventory) GetInventory() ([]*commonModel.Inventory, error)
- func (f FakeInventory) GetInventoryItem(id uint32) (*commonModel.Inventory, error)
- func (f FakeInventory) UpdateInventoryItem(id, userID, updateTime uint32) error
- type FakeUser
- type InventoryPort
- type UserPort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevicePort ¶
type DevicePort interface { CreateDevice(device *models.Device) (uint32, error) GetDevices() ([]*models.Device, error) GetDevice(id uint64) (*models.Device, error) UpdateDevice(id uint64, device *models.Device) error DeleteDevice(id uint64) error }
DevicePort interface for repository methods
type FakeDevice ¶
type FakeDevice struct {
HasError bool
}
FakeDevice provides fake method
func (FakeDevice) CreateDevice ¶
func (f FakeDevice) CreateDevice(inventory *models.Device) (uint32, error)
CreateDevice provides fake method
func (FakeDevice) DeleteDevice ¶
func (f FakeDevice) DeleteDevice(id uint64) error
DeleteDevice provides fake method
func (FakeDevice) GetDevice ¶
func (f FakeDevice) GetDevice(id uint64) (*models.Device, error)
GetDevice provides fake method
func (FakeDevice) GetDevices ¶
func (f FakeDevice) GetDevices() ([]*models.Device, error)
GetDevices provides fake method
func (FakeDevice) UpdateDevice ¶
func (f FakeDevice) UpdateDevice(id uint64, device *models.Device) error
UpdateDevice provides fake method
type FakeInventory ¶
type FakeInventory struct {
HasError bool
}
FakeInventory provides fake struct to mock repository methods
func (FakeInventory) CreateInventoryItem ¶
func (f FakeInventory) CreateInventoryItem(state *models.State) error
CreateInventoryItem mocks repository method
func (FakeInventory) DeleteInventoryItem ¶
func (f FakeInventory) DeleteInventoryItem(id uint32) error
DeleteInventoryItem mocks repository method
func (FakeInventory) GetInventory ¶
func (f FakeInventory) GetInventory() ([]*commonModel.Inventory, error)
GetInventory mocks repository method
func (FakeInventory) GetInventoryItem ¶
func (f FakeInventory) GetInventoryItem(id uint32) (*commonModel.Inventory, error)
GetInventoryItem mocks repository method
func (FakeInventory) UpdateInventoryItem ¶
func (f FakeInventory) UpdateInventoryItem(id, userID, updateTime uint32) error
UpdateInventoryItem mocks repository method
type FakeUser ¶
type FakeUser struct {
HasError bool
}
FakeUser provides struct to mock repository methods
func (FakeUser) CreateUser ¶
CreateUser mocks repository method
func (FakeUser) DeleteUser ¶
DeleteUser mocks repository method
type InventoryPort ¶
type InventoryPort interface { GetInventory() ([]*commonModel.Inventory, error) GetInventoryItem(id uint32) (*commonModel.Inventory, error) UpdateInventoryItem(id, userID, updateTime uint32) error CreateInventoryItem(state *models.State) error DeleteInventoryItem(id uint32) error }
InventoryPort interface for repository methods