Documentation ¶
Index ¶
- Variables
- type Device
- type Flow
- type Module
- type Storage
- type StorageImpl
- func (self *StorageImpl) CreateDevice(dev *Device) (*Device, error)
- func (self *StorageImpl) CreateFlow(flw *Flow) (*Flow, error)
- func (self *StorageImpl) CreateModule(mdl *Module) (*Module, error)
- func (self *StorageImpl) DeleteDevice(id string) error
- func (self *StorageImpl) DeleteFlow(id string) error
- func (self *StorageImpl) DeleteModule(id string) error
- func (self *StorageImpl) GetDevice(id string) (*Device, error)
- func (self *StorageImpl) GetDeviceByModuleId(id string) (*Device, error)
- func (self *StorageImpl) GetFlow(id string) (*Flow, error)
- func (self *StorageImpl) GetModule(id string) (*Module, error)
- func (self *StorageImpl) ListDevices(dev *Device) ([]*Device, error)
- func (self *StorageImpl) ListFlows(flw *Flow) ([]*Flow, error)
- func (self *StorageImpl) ListModules(mdl *Module) ([]*Module, error)
- func (self *StorageImpl) PatchDevice(id string, device *Device) (*Device, error)
- func (self *StorageImpl) PatchFlow(id string, flw *Flow) (*Flow, error)
- func (self *StorageImpl) PatchModule(id string, mdl *Module) (*Module, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
InvalidArgument = errors.New("invalid argument")
)
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { Id *string CreatedAt time.Time UpdatedAt time.Time HeartbeatAt *time.Time State *string `gorm:"column:state"` DeviceId *string `gorm:"column:device_id"` Endpoint *string `gorm:"column:endpoint"` Component *string `gorm:"column:component"` Name *string `gorm:"column:name"` Alias *string `gorm:"column:alias"` Device *Device `gorm:"-"` }
type Storage ¶
type Storage interface { CreateDevice(*Device) (*Device, error) DeleteDevice(id string) error PatchDevice(id string, device *Device) (*Device, error) GetDevice(id string) (*Device, error) ListDevices(*Device) ([]*Device, error) GetDeviceByModuleId(id string) (*Device, error) CreateModule(*Module) (*Module, error) DeleteModule(id string) error PatchModule(id string, module *Module) (*Module, error) GetModule(id string) (*Module, error) ListModules(*Module) ([]*Module, error) CreateFlow(*Flow) (*Flow, error) DeleteFlow(id string) error PatchFlow(id string, flow *Flow) (*Flow, error) GetFlow(id string) (*Flow, error) ListFlows(*Flow) ([]*Flow, error) }
func NewStorage ¶
type StorageImpl ¶
type StorageImpl struct {
// contains filtered or unexported fields
}
func NewStorageImpl ¶
func NewStorageImpl(driver, uri string, args ...interface{}) (*StorageImpl, error)
func (*StorageImpl) CreateDevice ¶
func (self *StorageImpl) CreateDevice(dev *Device) (*Device, error)
func (*StorageImpl) CreateFlow ¶
func (self *StorageImpl) CreateFlow(flw *Flow) (*Flow, error)
func (*StorageImpl) CreateModule ¶
func (self *StorageImpl) CreateModule(mdl *Module) (*Module, error)
func (*StorageImpl) DeleteDevice ¶
func (self *StorageImpl) DeleteDevice(id string) error
func (*StorageImpl) DeleteFlow ¶
func (self *StorageImpl) DeleteFlow(id string) error
func (*StorageImpl) DeleteModule ¶
func (self *StorageImpl) DeleteModule(id string) error
func (*StorageImpl) GetDeviceByModuleId ¶ added in v0.100.0
func (self *StorageImpl) GetDeviceByModuleId(id string) (*Device, error)
func (*StorageImpl) ListDevices ¶
func (self *StorageImpl) ListDevices(dev *Device) ([]*Device, error)
func (*StorageImpl) ListModules ¶
func (self *StorageImpl) ListModules(mdl *Module) ([]*Module, error)
func (*StorageImpl) PatchDevice ¶
func (self *StorageImpl) PatchDevice(id string, device *Device) (*Device, error)
func (*StorageImpl) PatchFlow ¶
func (self *StorageImpl) PatchFlow(id string, flw *Flow) (*Flow, error)
func (*StorageImpl) PatchModule ¶
func (self *StorageImpl) PatchModule(id string, mdl *Module) (*Module, error)
Click to show internal directories.
Click to hide internal directories.