Documentation ¶
Index ¶
- Constants
- type Device
- func (t *Device) ChangeDeviceCategory(deviceService DeviceService, category string) (*Device, error)
- func (t *Device) ChangeDeviceDescription(deviceService DeviceService, description string) (*Device, error)
- func (t *Device) ChangeDeviceDetails(deviceService DeviceService, details DeviceDomain) (*Device, error)
- func (t *Device) ChangeDeviceTitle(deviceService DeviceService, title string) (*Device, error)
- func (t *Device) TrackChange(deviceService DeviceService, event interface{}) error
- func (t *Device) Transition(deviceService DeviceService, event interface{}) error
- type DeviceAssetIDChanged
- type DeviceCategory
- type DeviceCategoryChanged
- type DeviceCreated
- type DeviceDescriptionChanged
- type DeviceDetailsChanged
- type DeviceDomain
- type DeviceDomainArea
- type DeviceDomainCrop
- type DeviceDomainFinance
- type DeviceDomainGeneral
- type DeviceDomainInventory
- type DeviceDomainReservoir
- type DeviceError
- type DeviceService
- type DeviceStatus
- type DeviceTitleChanged
- type ServiceResult
Constants ¶
const ( // DeviceCategoryRobot is a variable for category of a device DeviceCategoryRobot = "ROBOT" // DeviceCategorySensor is a variable for a category of a device DeviceCategorySensor = "SENSOR" )
const ( DeviceDomainAreaCode = "AREA" DeviceDomainCropCode = "CROP" DeviceDomainFinanceCode = "FINANCE" DeviceDomainGeneralCode = "GENERAL" DeviceDomainInventoryCode = "INVENTORY" DeviceDomainReservoirCode = "RESERVOIR" )
DeviceDomainAreaCode is used ...
const ( // DeviceErrorTitleEmptyCode is used DeviceErrorTitleEmptyCode = iota // DeviceErrorIDInvalidCode error DeviceErrorIDInvalidCode // DeviceErrorDescriptionEmptyCode Errors DeviceErrorDescriptionEmptyCode // DeviceErrorStatusEmptyCode is a status error DeviceErrorStatusEmptyCode // DeviceErrorInvalidStatusCode is a status error DeviceErrorInvalidStatusCode // DeviceErrorDomainEmptyCode gives Domain Errors DeviceErrorDomainEmptyCode // DeviceErrorInvalidDomainCode gives Domain Errors DeviceErrorInvalidDomainCode // DeviceErrorCategoryEmptyCode gives Category Errors DeviceErrorCategoryEmptyCode // DeviceErrorInvalidCategoryCode gives Category Errors DeviceErrorInvalidCategoryCode // DeviceErrorAssetIDEmptyCode gives Parent UID Errors DeviceErrorAssetIDEmptyCode // DeviceErrorInvalidAssetIDCode gives Parent UID Errors DeviceErrorInvalidAssetIDCode // DeviceErrorInventoryIDEmptyCode gives Task Domain Errors DeviceErrorInventoryIDEmptyCode // DeviceErrorInvalidInventoryIDCode gives Task Domain Errors DeviceErrorInvalidInventoryIDCode // DeviceErrorInvalidAreaIDCode gives Task Domain Errors DeviceErrorInvalidAreaIDCode // DeviceErrorDeviceNotFoundCode gives Device General Errors DeviceErrorDeviceNotFoundCode )
const ( DeviceCreatedCode = "DeviceCreated" DeviceTitleChangedCode = "DeviceTitleChanged" DeviceDescriptionChangedCode = "DeviceDescriptionChanged" DeviceCategoryChangedCode = "DeviceCategoryChanged" DeviceDetailsChangedCode = "DeviceDetailsChanged" DeviceAssetIDChangedCode = "DeviceAssetIDChanged" )
DeviceCreatedCode is used
const ( // DeviceStatusCreated defines status as 'start' DeviceStatusCreated = "START_DEVICE" // DeviceStatusCancelled defines status as 'stopped' DeviceStatusCancelled = "STOP_DEVICE" // DeviceStatusCompleted defines status as 'iddle' DeviceStatusCompleted = "DEVICE_IDLE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { UID uuid.UUID `json:"uid"` Title string `json:"title"` Description string `json:"description"` CreatedDate time.Time `json:"created_date"` //DueDate *time.Time `json:"due_date, omitempty"` //CompletedDate *time.Time `json:"completed_date"` //CancelledDate *time.Time `json:"cancelled_date"` //Priority string `json:"priority"` Status string `json:"status"` Domain string `json:"domain"` DomainDetails DeviceDomain `json:"domain_details"` Category string `json:"category"` //IsDue bool `json:"is_due"` AssetID *uuid.UUID `json:"asset_id"` // Events Version int UncommittedChanges []interface{} }
Device object is defined here
func CreateDevice ¶
func CreateDevice(deviceService DeviceService, title string, description string, devicedomain DeviceDomain, devicecategory string, assetid *uuid.UUID) (*Device, error)
CreateDevice is a function that will add a new device to the system
func (*Device) ChangeDeviceCategory ¶
func (t *Device) ChangeDeviceCategory(deviceService DeviceService, category string) (*Device, error)
ChangeDeviceCategory is a function used to update a device's category
func (*Device) ChangeDeviceDescription ¶
func (t *Device) ChangeDeviceDescription(deviceService DeviceService, description string) (*Device, error)
ChangeDeviceDescription is a function used to update a device's description
func (*Device) ChangeDeviceDetails ¶
func (t *Device) ChangeDeviceDetails(deviceService DeviceService, details DeviceDomain) (*Device, error)
ChangeDeviceDetails is a function used to update a device's details
func (*Device) ChangeDeviceTitle ¶
func (t *Device) ChangeDeviceTitle(deviceService DeviceService, title string) (*Device, error)
ChangeDeviceTitle is a function that allows the user to change title of a device
func (*Device) TrackChange ¶
func (t *Device) TrackChange(deviceService DeviceService, event interface{}) error
TrackChange is used
func (*Device) Transition ¶
func (t *Device) Transition(deviceService DeviceService, event interface{}) error
Transition is used
type DeviceAssetIDChanged ¶
type DeviceAssetIDChanged struct { UID uuid.UUID `json:"uid"` AssetID *uuid.UUID `json:"asset_id"` }
DeviceAssetIDChanged is used
type DeviceCategory ¶
DeviceCategory defines ...
func FindAllDeviceCategories ¶
func FindAllDeviceCategories() []DeviceCategory
FindAllDeviceCategories allows a user to filter a search
func FindDeviceCategoryByCode ¶
func FindDeviceCategoryByCode(code string) (DeviceCategory, error)
FindDeviceCategoryByCode allows a user to filter a search
type DeviceCategoryChanged ¶
DeviceCategoryChanged is used
type DeviceCreated ¶
type DeviceCreated struct { UID uuid.UUID `json:"uid"` Title string `json:"title"` Description string `json:"description"` CreatedDate time.Time `json:"created_date"` Status string `json:"status"` Domain string `json:"domain"` DomainDetails DeviceDomain `json:"domain_details"` Category string `json:"category"` AssetID *uuid.UUID `json:"asset_id"` }
DeviceCreated is used
type DeviceDescriptionChanged ¶
type DeviceDescriptionChanged struct { UID uuid.UUID `json:"uid"` Description string `json:"description"` }
DeviceDescriptionChanged is used ...
type DeviceDetailsChanged ¶
type DeviceDetailsChanged struct { UID uuid.UUID `json:"uid"` DomainDetails DeviceDomain `json:"domain_details"` }
DeviceDetailsChanged is used
type DeviceDomainArea ¶
DeviceDomainArea is used ...
func CreateDeviceDomainArea ¶
func CreateDeviceDomainArea(deviceService DeviceService, category string, materialID *uuid.UUID) (DeviceDomainArea, error)
CreateDeviceDomainArea is used ....
type DeviceDomainCrop ¶
type DeviceDomainCrop struct { MaterialID *uuid.UUID `json:"material_id"` AreaID *uuid.UUID `json:"area_id"` }
DeviceDomainCrop is used ...
func CreateDeviceDomainCrop ¶
func CreateDeviceDomainCrop(deviceService DeviceService, category string, materialID *uuid.UUID, areaID *uuid.UUID) (DeviceDomainCrop, error)
CreateDeviceDomainCrop is used ...
type DeviceDomainFinance ¶
type DeviceDomainFinance struct { }
DeviceDomainFinance ...
func CreateDeviceDomainFinance ¶
func CreateDeviceDomainFinance() (DeviceDomainFinance, error)
CreateDeviceDomainFinance is used ...
type DeviceDomainGeneral ¶
type DeviceDomainGeneral struct { }
DeviceDomainGeneral is used ...
func CreateDeviceDomainGeneral ¶
func CreateDeviceDomainGeneral() (DeviceDomainGeneral, error)
CreateDeviceDomainGeneral is used ....
type DeviceDomainInventory ¶
type DeviceDomainInventory struct { }
DeviceDomainInventory is used ...
func CreateDeviceDomainInventory ¶
func CreateDeviceDomainInventory() (DeviceDomainInventory, error)
CreateDeviceDomainInventory is used ...
type DeviceDomainReservoir ¶
DeviceDomainReservoir is used ...
func CreateDeviceDomainReservoir ¶
func CreateDeviceDomainReservoir(deviceService DeviceService, category string, materialID *uuid.UUID) (DeviceDomainReservoir, error)
CreateDeviceDomainReservoir is used ...
type DeviceError ¶
type DeviceError struct {
Code int
}
DeviceError is a custom error from Go built-in error
func (DeviceError) Error ¶
func (e DeviceError) Error() string
type DeviceService ¶
type DeviceService interface { FindAreaByID(uid uuid.UUID) ServiceResult FindCropByID(uid uuid.UUID) ServiceResult FindMaterialByID(uid uuid.UUID) ServiceResult FindReservoirByID(uid uuid.UUID) ServiceResult }
DeviceService is used
type DeviceStatus ¶
DeviceStatus is used ...
func FindDeviceStatusByCode ¶
func FindDeviceStatusByCode(code string) (DeviceStatus, error)
FindDeviceStatusByCode is used ...
type DeviceTitleChanged ¶
DeviceTitleChanged is used ...
type ServiceResult ¶
type ServiceResult struct { Result interface{} Error error }
ServiceResult is the container for service result