repository

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

func (f FakeUser) CreateUser(inventory *models.User) error

CreateUser mocks repository method

func (FakeUser) DeleteUser

func (f FakeUser) DeleteUser(id uint64) error

DeleteUser mocks repository method

func (FakeUser) GetUser

func (f FakeUser) GetUser(id uint64) (*models.User, error)

GetUser mocks repository method

func (FakeUser) GetUsers

func (f FakeUser) GetUsers() ([]*models.User, error)

GetUsers mocks repository method

func (FakeUser) UpdateUser

func (f FakeUser) UpdateUser(id uint64, user *models.User) error

UpdateUser 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

type UserPort

type UserPort interface {
	CreateUser(user *models.User) error
	GetUsers() ([]*models.User, error)
	GetUser(id uint64) (*models.User, error)
	UpdateUser(id uint64, user *models.User) error
	DeleteUser(id uint64) error
}

UserPort interface for repository methods

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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