adaptors

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRecordNotFound ...
	ErrRecordNotFound = errors.New("record not found")
)

Functions

This section is empty.

Types

type Adaptors

type Adaptors struct {
	Node                  *Node
	Script                *Script
	Workflow              *Workflow
	WorkflowScenario      *WorkflowScenario
	Device                *Device
	DeviceAction          *DeviceAction
	DeviceState           *DeviceState
	Flow                  *Flow
	FlowElement           *FlowElement
	FlowSubscription      *FlowSubscription
	FlowZigbee2mqttDevice *FlowZigbee2mqttDevice
	Connection            *Connection
	Worker                *Worker
	Role                  *Role
	Permission            *Permission
	User                  *User
	UserMeta              *UserMeta
	Image                 *Image
	Variable              *Variable
	Map                   *Map
	MapLayer              *MapLayer
	MapText               *MapText
	MapImage              *MapImage
	MapDevice             *MapDevice
	MapElement            *MapElement
	MapDeviceState        *MapDeviceState
	MapDeviceAction       *MapDeviceAction
	Log                   *Log
	MapZone               *MapZone
	Template              *Template
	Message               *Message
	MessageDelivery       *MessageDelivery
	Zigbee2mqtt           *Zigbee2mqtt
	Zigbee2mqttDevice     *Zigbee2mqttDevice
	MapDeviceHistory      *MapDeviceHistory
	AlexaSkill            *AlexaSkill
	AlexaIntent           *AlexaIntent
	Storage               *Storage
	// contains filtered or unexported fields
}

Adaptors ...

func NewAdaptors

func NewAdaptors(db *gorm.DB,
	cfg *config.AppConfig,
	migrations *migrations.Migrations) (adaptors *Adaptors)

NewAdaptors ...

func (Adaptors) Begin added in v0.1.0

func (a Adaptors) Begin() (adaptors *Adaptors)

Begin ...

func (*Adaptors) Commit added in v0.1.0

func (a *Adaptors) Commit() error

Commit ...

func (*Adaptors) Rollback added in v0.1.0

func (a *Adaptors) Rollback() error

Rollback ...

type AlexaIntent added in v0.3.0

type AlexaIntent struct {
	// contains filtered or unexported fields
}

AlexaIntent ...

func GetAlexaIntentAdaptor added in v0.3.0

func GetAlexaIntentAdaptor(d *gorm.DB) *AlexaIntent

GetAlexaIntentAdaptor ...

func (*AlexaIntent) Add added in v0.3.0

func (n *AlexaIntent) Add(ver *m.AlexaIntent) (id int64, err error)

Add ...

func (*AlexaIntent) Delete added in v0.3.0

func (n *AlexaIntent) Delete(ver *m.AlexaIntent) (err error)

Delete ...

func (*AlexaIntent) GetByName added in v0.3.0

func (n *AlexaIntent) GetByName(name string) (ver *m.AlexaIntent, err error)

GetByName ...

func (*AlexaIntent) Update added in v0.3.0

func (n *AlexaIntent) Update(ver *m.AlexaIntent) (err error)

Update ...

type AlexaSkill added in v0.3.0

type AlexaSkill struct {
	// contains filtered or unexported fields
}

AlexaSkill ...

func GetAlexaSkillAdaptor added in v0.3.0

func GetAlexaSkillAdaptor(d *gorm.DB) *AlexaSkill

GetAlexaSkillAdaptor ...

func (*AlexaSkill) Add added in v0.3.0

func (n *AlexaSkill) Add(app *m.AlexaSkill) (id int64, err error)

Add ...

func (*AlexaSkill) Delete added in v0.3.0

func (n *AlexaSkill) Delete(appId int64) (err error)

Delete ...

func (*AlexaSkill) GetById added in v0.3.0

func (n *AlexaSkill) GetById(appId int64) (app *m.AlexaSkill, err error)

GetById ...

func (*AlexaSkill) List added in v0.3.0

func (n *AlexaSkill) List(limit, offset int64, orderBy, sort string) (list []*m.AlexaSkill, total int64, err error)

List ...

func (*AlexaSkill) ListEnabled added in v0.3.0

func (n *AlexaSkill) ListEnabled(limit, offset int64) (list []*m.AlexaSkill, err error)

ListEnabled ...

func (*AlexaSkill) Update added in v0.3.0

func (n *AlexaSkill) Update(params *m.AlexaSkill) (err error)

Update ...

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

Connection ...

func GetConnectionAdaptor

func GetConnectionAdaptor(d *gorm.DB) *Connection

GetConnectionAdaptor ...

func (*Connection) Add

func (n *Connection) Add(con *m.Connection) (id uuid.UUID, err error)

Add ...

func (*Connection) AddOrUpdateConnection

func (n *Connection) AddOrUpdateConnection(connection *m.Connection) (err error)

AddOrUpdateConnection ...

func (*Connection) Delete

func (n *Connection) Delete(conIds []uuid.UUID) (err error)

Delete ...

func (*Connection) GetById

func (n *Connection) GetById(conId uuid.UUID) (con *m.Connection, err error)

GetById ...

func (*Connection) List

func (n *Connection) List(limit, offset int64, orderBy, sort string) (list []*m.Connection, total int64, err error)

List ...

func (*Connection) Update

func (n *Connection) Update(con *m.Connection) (err error)

Update ...

type Device

type Device struct {
	// contains filtered or unexported fields
}

Device ...

func GetDeviceAdaptor

func GetDeviceAdaptor(d *gorm.DB) *Device

GetDeviceAdaptor ...

func (*Device) Add

func (n *Device) Add(device *m.Device) (id int64, err error)

Add ...

func (*Device) Delete

func (n *Device) Delete(deviceId int64) (err error)

Delete ...

func (*Device) GetAllEnabled

func (n *Device) GetAllEnabled() (list []*m.Device, err error)

GetAllEnabled ...

func (*Device) GetByDeviceActionId added in v0.3.0

func (n *Device) GetByDeviceActionId(deviceActionId int64) (device *m.Device, err error)

GetByDeviceActionId ...

func (*Device) GetById

func (n *Device) GetById(deviceId int64) (device *m.Device, err error)

GetById ...

func (*Device) List

func (n *Device) List(limit, offset int64, orderBy, sort string) (list []*m.Device, total int64, err error)

List ...

func (*Device) Search

func (n *Device) Search(query string, limit, offset int) (list []*m.Device, total int64, err error)

Search ...

func (*Device) Update

func (n *Device) Update(device *m.Device) (err error)

Update ...

type DeviceAction

type DeviceAction struct {
	// contains filtered or unexported fields
}

DeviceAction ...

func GetDeviceActionAdaptor

func GetDeviceActionAdaptor(d *gorm.DB) *DeviceAction

GetDeviceActionAdaptor ...

func (*DeviceAction) Add

func (n *DeviceAction) Add(device *m.DeviceAction) (id int64, err error)

Add ...

func (*DeviceAction) Delete

func (n *DeviceAction) Delete(deviceId int64) (err error)

Delete ...

func (*DeviceAction) GetByDeviceId

func (n *DeviceAction) GetByDeviceId(deviceId int64) (actions []*m.DeviceAction, err error)

GetByDeviceId ...

func (*DeviceAction) GetById

func (n *DeviceAction) GetById(actionId int64) (device *m.DeviceAction, err error)

GetById ...

func (*DeviceAction) List

func (n *DeviceAction) List(limit, offset int64, orderBy, sort string) (list []*m.DeviceAction, total int64, err error)

List ...

func (*DeviceAction) Search

func (n *DeviceAction) Search(query string, limit, offset int) (list []*m.DeviceAction, total int64, err error)

Search ...

func (*DeviceAction) Update

func (n *DeviceAction) Update(device *m.DeviceAction) (err error)

Update ...

type DeviceDefault

type DeviceDefault struct {
	Address *int `json:"address"`
}

DeviceDefault ...

type DeviceSmartBus

type DeviceSmartBus struct {
	Address  *int          `json:"address"`
	Baud     int           `json:"baud"`
	Sleep    int64         `json:"sleep"`
	StopBite int64         `json:"stop_bite"`
	Timeout  time.Duration `json:"timeout"`
	Tty      string        `json:"tty"`
}

DeviceSmartBus ...

type DeviceState

type DeviceState struct {
	// contains filtered or unexported fields
}

DeviceState ...

func GetDeviceStateAdaptor

func GetDeviceStateAdaptor(d *gorm.DB) *DeviceState

GetDeviceStateAdaptor ...

func (*DeviceState) Add

func (n *DeviceState) Add(device *m.DeviceState) (id int64, err error)

Add ...

func (*DeviceState) Delete

func (n *DeviceState) Delete(deviceId int64) (err error)

Delete ...

func (*DeviceState) GetByDeviceId

func (n *DeviceState) GetByDeviceId(deviceId int64) (states []*m.DeviceState, err error)

GetByDeviceId ...

func (*DeviceState) GetById

func (n *DeviceState) GetById(deviceId int64) (device *m.DeviceState, err error)

GetById ...

func (*DeviceState) List

func (n *DeviceState) List(limit, offset int64, orderBy, sort string) (list []*m.DeviceState, total int64, err error)

List ...

func (*DeviceState) Update

func (n *DeviceState) Update(device *m.DeviceState) (err error)

Update ...

type DeviceZigBee

type DeviceZigBee struct {
	Address string `json:"address"`
}

DeviceZigBee ...

type Flow

type Flow struct {
	// contains filtered or unexported fields
}

Flow ...

func GetFlowAdaptor

func GetFlowAdaptor(d *gorm.DB) *Flow

GetFlowAdaptor ...

func (*Flow) Add

func (n *Flow) Add(flow *m.Flow) (id int64, err error)

Add ...

func (*Flow) Delete

func (n *Flow) Delete(flowId int64) (err error)

Delete ...

func (*Flow) GetAllEnabled

func (n *Flow) GetAllEnabled() (list []*m.Flow, err error)

GetAllEnabled ...

func (*Flow) GetAllEnabledByWorkflow

func (n *Flow) GetAllEnabledByWorkflow(workflowId int64) (list []*m.Flow, err error)

GetAllEnabledByWorkflow ...

func (*Flow) GetById

func (n *Flow) GetById(flowId int64) (flow *m.Flow, err error)

GetById ...

func (*Flow) List

func (n *Flow) List(limit, offset int64, orderBy, sort string) (list []*m.Flow, total int64, err error)

List ...

func (*Flow) Search

func (n *Flow) Search(query string, limit, offset int) (list []*m.Flow, total int64, err error)

Search ...

func (*Flow) Update

func (n *Flow) Update(flow *m.Flow) (err error)

Update ...

type FlowElement

type FlowElement struct {
	// contains filtered or unexported fields
}

FlowElement ...

func GetFlowElementAdaptor

func GetFlowElementAdaptor(d *gorm.DB) *FlowElement

GetFlowElementAdaptor ...

func (*FlowElement) Add

func (n *FlowElement) Add(element *m.FlowElement) (id uuid.UUID, err error)

Add ...

func (*FlowElement) AddOrUpdateFlowElement

func (n *FlowElement) AddOrUpdateFlowElement(element *m.FlowElement) (err error)

AddOrUpdateFlowElement ...

func (*FlowElement) Delete

func (n *FlowElement) Delete(ids []uuid.UUID) (err error)

Delete ...

func (*FlowElement) GetAllEnabled

func (n *FlowElement) GetAllEnabled() (list []*m.FlowElement, err error)

GetAllEnabled ...

func (*FlowElement) GetById

func (n *FlowElement) GetById(elementId uuid.UUID) (element *m.FlowElement, err error)

GetById ...

func (*FlowElement) List

func (n *FlowElement) List(limit, offset int64, orderBy, sort string) (list []*m.FlowElement, total int64, err error)

List ...

func (*FlowElement) Update

func (n *FlowElement) Update(element *m.FlowElement) (err error)

Update ...

type FlowSubscription added in v0.0.21

type FlowSubscription struct {
	// contains filtered or unexported fields
}

FlowSubscription ...

func GetFlowSubscriptionAdaptor added in v0.0.21

func GetFlowSubscriptionAdaptor(Db *gorm.DB) *FlowSubscription

GetFlowSubscriptionAdaptor ...

func (*FlowSubscription) Add added in v0.0.21

func (f *FlowSubscription) Add(sub *m.FlowSubscription) (err error)

Add ...

func (*FlowSubscription) Remove added in v0.0.21

func (f *FlowSubscription) Remove(ids []int64) (err error)

Remove ...

type FlowZigbee2mqttDevice added in v0.1.0

type FlowZigbee2mqttDevice struct {
	// contains filtered or unexported fields
}

FlowZigbee2mqttDevice ...

func GetFlowZigbee2mqttDeviceAdaptor added in v0.1.0

func GetFlowZigbee2mqttDeviceAdaptor(Db *gorm.DB) *FlowZigbee2mqttDevice

GetFlowZigbee2mqttDeviceAdaptor ...

func (*FlowZigbee2mqttDevice) Add added in v0.1.0

Add ...

func (*FlowZigbee2mqttDevice) Remove added in v0.1.0

func (f *FlowZigbee2mqttDevice) Remove(flowId int64, ids []string) (err error)

Remove ...

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image ...

func GetImageAdaptor

func GetImageAdaptor(d *gorm.DB) *Image

GetImageAdaptor ...

func (*Image) Add

func (n *Image) Add(ver *m.Image) (id int64, err error)

Add ...

func (*Image) AddMultiple

func (n *Image) AddMultiple(items []*m.Image) (err error)

AddMultiple ...

func (*Image) Delete

func (n *Image) Delete(mapId int64) (err error)

Delete ...

func (*Image) GetAllByDate

func (n *Image) GetAllByDate(filter string) (images []*m.Image, err error)

GetAllByDate ...

func (*Image) GetById

func (n *Image) GetById(mapId int64) (ver *m.Image, err error)

GetById ...

func (*Image) GetByImageName added in v0.2.0

func (n *Image) GetByImageName(imageName string) (ver *m.Image, err error)

GetByImageName ...

func (*Image) GetFilterList

func (n *Image) GetFilterList() (filterList []*m.ImageFilterList, err error)

GetFilterList ...

func (*Image) List

func (n *Image) List(limit, offset int64, orderBy, sort string) (list []*m.Image, total int64, err error)

List ...

func (*Image) Update

func (n *Image) Update(ver *m.Image) (err error)

Update ...

func (*Image) UploadImage

func (n *Image) UploadImage(reader *bufio.Reader, fileName string) (err error)

UploadImage ...

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log ...

func GetLogAdaptor

func GetLogAdaptor(d *gorm.DB) *Log

GetLogAdaptor ...

func (*Log) Add

func (n *Log) Add(ver *m.Log) (id int64, err error)

Add ...

func (*Log) AddMultiple added in v0.0.19

func (n *Log) AddMultiple(items []*m.Log) (err error)

AddMultiple ...

func (*Log) Delete

func (n *Log) Delete(verId int64) (err error)

Delete ...

func (*Log) GetById

func (n *Log) GetById(verId int64) (ver *m.Log, err error)

GetById ...

func (*Log) List

func (n *Log) List(limit, offset int64, orderBy, sort string, queryObj *m.LogQuery) (list []*m.Log, total int64, err error)

List ...

func (*Log) Search

func (n *Log) Search(query string, limit, offset int) (list []*m.Log, total int64, err error)

Search ...

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map ...

func GetMapAdaptor

func GetMapAdaptor(d *gorm.DB) *Map

GetMapAdaptor ...

func (*Map) Add

func (n *Map) Add(ver *m.Map) (id int64, err error)

Add ...

func (*Map) Delete

func (n *Map) Delete(mapId int64) (err error)

Delete ...

func (*Map) GetById

func (n *Map) GetById(mapId int64) (ver *m.Map, err error)

GetById ...

func (*Map) GetFullById

func (n *Map) GetFullById(mapId int64) (ver *m.Map, err error)

GetFullById ...

func (*Map) List

func (n *Map) List(limit, offset int64, orderBy, sort string) (list []*m.Map, total int64, err error)

List ...

func (*Map) Search

func (n *Map) Search(query string, limit, offset int) (list []*m.Map, total int64, err error)

Search ...

func (*Map) Update

func (n *Map) Update(ver *m.Map) (err error)

Update ...

type MapDevice

type MapDevice struct {
	// contains filtered or unexported fields
}

MapDevice ...

func GetMapDeviceAdaptor

func GetMapDeviceAdaptor(d *gorm.DB) *MapDevice

GetMapDeviceAdaptor ...

func (*MapDevice) Add

func (n *MapDevice) Add(ver *m.MapDevice) (id int64, err error)

Add ...

func (*MapDevice) Delete

func (n *MapDevice) Delete(mapId int64) (err error)

Delete ...

func (*MapDevice) GetById

func (n *MapDevice) GetById(mapId int64) (ver *m.MapDevice, err error)

GetById ...

type MapDeviceAction

type MapDeviceAction struct {
	// contains filtered or unexported fields
}

MapDeviceAction ...

func GetMapDeviceActionAdaptor

func GetMapDeviceActionAdaptor(d *gorm.DB) *MapDeviceAction

GetMapDeviceActionAdaptor ...

func (*MapDeviceAction) Add

func (n *MapDeviceAction) Add(ver *m.MapDeviceAction) (id int64, err error)

Add ...

func (*MapDeviceAction) AddMultiple

func (n *MapDeviceAction) AddMultiple(items []*m.MapDeviceAction) (err error)

AddMultiple ...

type MapDeviceHistory added in v0.2.0

type MapDeviceHistory struct {
	// contains filtered or unexported fields
}

MapDeviceHistory ...

func GetMapDeviceHistoryAdaptor added in v0.2.0

func GetMapDeviceHistoryAdaptor(d *gorm.DB) *MapDeviceHistory

GetMapDeviceHistoryAdaptor ...

func (*MapDeviceHistory) Add added in v0.2.0

func (n *MapDeviceHistory) Add(ver m.MapDeviceHistory) (id int64, err error)

Add ...

func (*MapDeviceHistory) List added in v0.2.0

func (n *MapDeviceHistory) List(limit, offset int) (list []*m.MapDeviceHistory, err error)

List ...

func (*MapDeviceHistory) ListByDeviceId added in v0.2.0

func (n *MapDeviceHistory) ListByDeviceId(mapDeviceId int64, limit, offset int) (list []*m.MapDeviceHistory, total int64, err error)

ListByDeviceId ...

func (*MapDeviceHistory) ListByElementId added in v0.2.0

func (n *MapDeviceHistory) ListByElementId(mapElementId int64, limit, offset int) (list []*m.MapDeviceHistory, total int64, err error)

ListByElementId ...

func (*MapDeviceHistory) ListByMapId added in v0.2.0

func (n *MapDeviceHistory) ListByMapId(mapId int64, limit, offset int, orderBy, sort string) (list []*m.MapDeviceHistory, total int64, err error)

ListByMapId ...

type MapDeviceState

type MapDeviceState struct {
	// contains filtered or unexported fields
}

MapDeviceState ...

func GetMapDeviceStateAdaptor

func GetMapDeviceStateAdaptor(d *gorm.DB) *MapDeviceState

GetMapDeviceStateAdaptor ...

func (*MapDeviceState) Add

func (n *MapDeviceState) Add(ver *m.MapDeviceState) (id int64, err error)

Add ...

func (*MapDeviceState) AddMultiple

func (n *MapDeviceState) AddMultiple(items []*m.MapDeviceState) (err error)

AddMultiple ...

type MapElement

type MapElement struct {
	// contains filtered or unexported fields
}

MapElement ...

func GetMapElementAdaptor

func GetMapElementAdaptor(d *gorm.DB) *MapElement

GetMapElementAdaptor ...

func (*MapElement) Add

func (n *MapElement) Add(ver *m.MapElement) (id int64, err error)

Add ...

func (*MapElement) Delete

func (n *MapElement) Delete(mapId int64) (err error)

Delete ...

func (*MapElement) GetActiveElements added in v0.0.14

func (n *MapElement) GetActiveElements(sortBy, order string, limit, offset int) (result []*m.MapElement, total int64, err error)

GetActiveElements ...

func (*MapElement) GetById

func (n *MapElement) GetById(mapId int64) (ver *m.MapElement, err error)

GetById ...

func (*MapElement) GetByName added in v0.2.0

func (n *MapElement) GetByName(name string) (ver *m.MapElement, err error)

GetByName ...

func (*MapElement) List

func (n *MapElement) List(limit, offset int64, orderBy, sort string) (list []*m.MapElement, total int64, err error)

List ...

func (*MapElement) Sort

func (n *MapElement) Sort(ver *m.MapElement) (err error)

Sort ...

func (*MapElement) Update

func (n *MapElement) Update(ver *m.MapElement) (err error)

Update ...

type MapImage

type MapImage struct {
	// contains filtered or unexported fields
}

MapImage ...

func GetMapImageAdaptor

func GetMapImageAdaptor(d *gorm.DB) *MapImage

GetMapImageAdaptor ...

func (*MapImage) Add

func (n *MapImage) Add(ver *m.MapImage) (id int64, err error)

Add ...

func (*MapImage) Delete

func (n *MapImage) Delete(mapId int64) (err error)

Delete ...

func (*MapImage) GetById

func (n *MapImage) GetById(mapId int64) (ver *m.MapImage, err error)

GetById ...

func (*MapImage) List

func (n *MapImage) List(limit, offset int64, orderBy, sort string) (list []*m.MapImage, total int64, err error)

List ...

func (*MapImage) Sort

func (n *MapImage) Sort(ver *m.MapImage) (err error)

Sort ...

func (*MapImage) Update

func (n *MapImage) Update(ver *m.MapImage) (err error)

Update ...

type MapLayer

type MapLayer struct {
	// contains filtered or unexported fields
}

MapLayer ...

func GetMapLayerAdaptor

func GetMapLayerAdaptor(d *gorm.DB) *MapLayer

GetMapLayerAdaptor ...

func (*MapLayer) Add

func (n *MapLayer) Add(ver *m.MapLayer) (id int64, err error)

Add ...

func (*MapLayer) Delete

func (n *MapLayer) Delete(mapId int64) (err error)

Delete ...

func (*MapLayer) GetById

func (n *MapLayer) GetById(mapId int64) (ver *m.MapLayer, err error)

GetById ...

func (*MapLayer) List

func (n *MapLayer) List(limit, offset int64, orderBy, sort string) (list []*m.MapLayer, total int64, err error)

List ...

func (*MapLayer) Sort

func (n *MapLayer) Sort(ver *m.MapLayer) (err error)

Sort ...

func (*MapLayer) Update

func (n *MapLayer) Update(ver *m.MapLayer) (err error)

Update ...

type MapText

type MapText struct {
	// contains filtered or unexported fields
}

MapText ...

func GetMapTextAdaptor

func GetMapTextAdaptor(d *gorm.DB) *MapText

GetMapTextAdaptor ...

func (*MapText) Add

func (n *MapText) Add(ver *m.MapText) (id int64, err error)

Add ...

func (*MapText) Delete

func (n *MapText) Delete(mapId int64) (err error)

Delete ...

func (*MapText) GetById

func (n *MapText) GetById(mapId int64) (ver *m.MapText, err error)

GetById ...

func (*MapText) List

func (n *MapText) List(limit, offset int64, orderBy, sort string) (list []*m.MapText, total int64, err error)

List ...

func (*MapText) Sort

func (n *MapText) Sort(ver *m.MapText) (err error)

Sort ...

func (*MapText) Update

func (n *MapText) Update(ver *m.MapText) (err error)

Update ...

type MapZone added in v0.0.14

type MapZone struct {
	// contains filtered or unexported fields
}

MapZone ...

func GetMapZoneAdaptor added in v0.0.14

func GetMapZoneAdaptor(d *gorm.DB) *MapZone

GetMapZoneAdaptor ...

func (*MapZone) Add added in v0.0.14

func (n *MapZone) Add(tag *m.MapZone) (id int64, err error)

Add ...

func (*MapZone) Clean added in v0.0.14

func (n *MapZone) Clean() (err error)

Clean ...

func (*MapZone) Delete added in v0.0.14

func (n *MapZone) Delete(name string) (err error)

Delete ...

func (*MapZone) GetByName added in v0.0.14

func (n *MapZone) GetByName(zoneName string) (ver *m.MapZone, err error)

GetByName ...

func (*MapZone) Search added in v0.0.14

func (n *MapZone) Search(query string, limit, offset int) (list []*m.MapZone, total int64, err error)

Search ...

type Message added in v0.0.17

type Message struct {
	// contains filtered or unexported fields
}

Message ...

func GetMessageAdaptor added in v0.0.17

func GetMessageAdaptor(d *gorm.DB) *Message

GetMessageAdaptor ...

func (*Message) Add added in v0.0.17

func (n *Message) Add(msg *m.Message) (id int64, err error)

Add ...

type MessageDelivery added in v0.0.17

type MessageDelivery struct {
	// contains filtered or unexported fields
}

MessageDelivery ...

func GetMessageDeliveryAdaptor added in v0.0.17

func GetMessageDeliveryAdaptor(d *gorm.DB) *MessageDelivery

GetMessageDeliveryAdaptor ...

func (*MessageDelivery) Add added in v0.0.17

func (n *MessageDelivery) Add(msg *m.MessageDelivery) (id int64, err error)

Add ...

func (*MessageDelivery) Delete added in v0.0.17

func (n *MessageDelivery) Delete(id int64) (err error)

Delete ...

func (*MessageDelivery) GetAllUncompleted added in v0.0.17

func (n *MessageDelivery) GetAllUncompleted(limit, offset int64) (list []*m.MessageDelivery, total int64, err error)

GetAllUncompleted ...

func (*MessageDelivery) GetById added in v0.0.17

func (n *MessageDelivery) GetById(id int64) (ver *m.MessageDelivery, err error)

GetById ...

func (*MessageDelivery) List added in v0.0.17

func (n *MessageDelivery) List(limit, offset int64, orderBy, sort string) (list []*m.MessageDelivery, total int64, err error)

List ...

func (*MessageDelivery) SetStatus added in v0.0.17

func (n *MessageDelivery) SetStatus(msg *m.MessageDelivery) (err error)

SetStatus ...

type Node

type Node struct {
	// contains filtered or unexported fields
}

Node ...

func GetNodeAdaptor

func GetNodeAdaptor(d *gorm.DB) *Node

GetNodeAdaptor ...

func (*Node) Add

func (n *Node) Add(node *m.Node) (id int64, err error)

Add ...

func (*Node) Delete

func (n *Node) Delete(nodeId int64) (err error)

Delete ...

func (*Node) GetAllEnabled

func (n *Node) GetAllEnabled() (list []*m.Node, err error)

GetAllEnabled ...

func (*Node) GetById

func (n *Node) GetById(nodeId int64) (node *m.Node, err error)

GetById ...

func (*Node) GetByLogin

func (a *Node) GetByLogin(login string) (ver *m.Node, err error)

GetByLogin ...

func (*Node) GetByName added in v0.2.0

func (a *Node) GetByName(name string) (ver *m.Node, err error)

GetByName ...

func (*Node) List

func (n *Node) List(limit, offset int64, orderBy, sort string) (list []*m.Node, total int64, err error)

List ...

func (*Node) Search

func (n *Node) Search(query string, limit, offset int) (list []*m.Node, total int64, err error)

Search ...

func (*Node) Update

func (n *Node) Update(node *m.Node) (err error)

Update ...

type Permission

type Permission struct {
	// contains filtered or unexported fields
}

Permission ...

func GetPermissionAdaptor

func GetPermissionAdaptor(d *gorm.DB) *Permission

GetPermissionAdaptor ...

func (*Permission) Add

func (n *Permission) Add(permission *m.Permission) (id int64, err error)

Add ...

func (*Permission) Delete

func (n *Permission) Delete(packageName string, levelName []string) (err error)

Delete ...

func (*Permission) GetAllPermissions

func (n *Permission) GetAllPermissions(roleName string) (permissions []*m.Permission, err error)

GetAllPermissions ...

type Role

type Role struct {
	// contains filtered or unexported fields
}

Role ...

func GetRoleAdaptor

func GetRoleAdaptor(d *gorm.DB) *Role

GetRoleAdaptor ...

func (*Role) Add

func (n *Role) Add(role *m.Role) (err error)

Add ...

func (*Role) Delete

func (n *Role) Delete(name string) (err error)

Delete ...

func (*Role) GetAccessList

func (n *Role) GetAccessList(role *m.Role) (err error)

GetAccessList ...

func (*Role) GetByName

func (n *Role) GetByName(name string) (role *m.Role, err error)

GetByName ...

func (*Role) List

func (n *Role) List(limit, offset int64, orderBy, sort string) (list []*m.Role, total int64, err error)

List ...

func (*Role) Search

func (n *Role) Search(query string, limit, offset int) (list []*m.Role, total int64, err error)

Search ...

func (*Role) Update

func (n *Role) Update(role *m.Role) (err error)

Update ...

type Script

type Script struct {
	// contains filtered or unexported fields
}

Script ...

func GetScriptAdaptor

func GetScriptAdaptor(d *gorm.DB) *Script

GetScriptAdaptor ...

func (*Script) Add

func (n *Script) Add(script *m.Script) (id int64, err error)

Add ...

func (*Script) Delete

func (n *Script) Delete(scriptId int64) (err error)

Delete ...

func (*Script) GetById

func (n *Script) GetById(scriptId int64) (script *m.Script, err error)

GetById ...

func (*Script) List

func (n *Script) List(limit, offset int64, orderBy, sort string) (list []*m.Script, total int64, err error)

List ...

func (*Script) Search

func (n *Script) Search(query string, limit, offset int) (list []*m.Script, total int64, err error)

Search ...

func (*Script) Update

func (n *Script) Update(script *m.Script) (err error)

Update ...

type Storage added in v0.4.0

type Storage struct {
	// contains filtered or unexported fields
}

Storage ...

func GetStorageAdaptor added in v0.4.0

func GetStorageAdaptor(d *gorm.DB) *Storage

GetStorageAdaptor ...

func (*Storage) CreateOrUpdate added in v0.4.0

func (s *Storage) CreateOrUpdate(ver m.Storage) (err error)

CreateOrUpdate ...

func (*Storage) Delete added in v0.4.0

func (s *Storage) Delete(name string) (err error)

Delete ...

func (*Storage) GetByName added in v0.4.0

func (s *Storage) GetByName(name string) (ver m.Storage, err error)

GetByName ...

func (*Storage) Search added in v0.4.0

func (s *Storage) Search(query string, limit, offset int) (list []m.Storage, total int64, err error)

Search ...

type Template added in v0.0.17

type Template struct {
	// contains filtered or unexported fields
}

Template ...

func GetTemplateAdaptor added in v0.0.17

func GetTemplateAdaptor(d *gorm.DB) *Template

GetTemplateAdaptor ...

func (*Template) Create added in v0.0.17

func (n *Template) Create(ver *m.Template) (err error)

Create ...

func (*Template) Delete added in v0.0.17

func (n *Template) Delete(name string) (err error)

Delete ...

func (*Template) GetByName added in v0.0.17

func (n *Template) GetByName(name string) (ver *m.Template, err error)

GetByName ...

func (*Template) GetItemByName added in v0.0.17

func (n *Template) GetItemByName(name string) (ver *m.Template, err error)

GetItemByName ...

func (*Template) GetItemsSortedList added in v0.0.17

func (n *Template) GetItemsSortedList() (count int64, items []string, err error)

GetItemsSortedList ...

func (*Template) GetItemsTree added in v0.0.17

func (n *Template) GetItemsTree() (tree []*m.TemplateTree, err error)

GetItemsTree ...

func (*Template) GetList added in v0.0.17

func (n *Template) GetList(templateType m.TemplateType) (items []*m.Template, err error)

GetList ...

func (*Template) GetMarkers added in v0.0.17

func (n *Template) GetMarkers(template *m.Template) (err error)

GetMarkers ...

func (*Template) Render added in v0.0.17

func (n *Template) Render(name string, params map[string]interface{}) (render *m.TemplateRender, err error)

Render ...

func (*Template) Search added in v0.0.17

func (n *Template) Search(query string, limit, offset int) (list []*m.Template, total int64, err error)

Search ...

func (*Template) UpdateItemsTree added in v0.0.17

func (n *Template) UpdateItemsTree(tree []*m.TemplateTree) (err error)

UpdateItemsTree ...

func (*Template) UpdateOrCreate added in v0.0.17

func (n *Template) UpdateOrCreate(ver *m.Template) (err error)

UpdateOrCreate ...

func (*Template) UpdateStatus added in v0.0.17

func (n *Template) UpdateStatus(ver *m.Template) (err error)

UpdateStatus ...

type User

type User struct {
	// contains filtered or unexported fields
}

User ...

func GetUserAdaptor

func GetUserAdaptor(d *gorm.DB) *User

GetUserAdaptor ...

func (*User) Add

func (n *User) Add(user *m.User) (id int64, err error)

Add ...

func (*User) ClearResetPassToken

func (n *User) ClearResetPassToken(u *m.User) (err error)

ClearResetPassToken ...

func (*User) ClearToken

func (n *User) ClearToken(u *m.User) (err error)

ClearToken ...

func (*User) Delete

func (n *User) Delete(userId int64) (err error)

Delete ...

func (*User) GenResetPassToken

func (n *User) GenResetPassToken(u *m.User) (token string, err error)

GenResetPassToken ...

func (*User) GetByAuthenticationToken

func (n *User) GetByAuthenticationToken(token string) (user *m.User, err error)

GetByAuthenticationToken ...

func (*User) GetByEmail

func (n *User) GetByEmail(email string) (user *m.User, err error)

GetByEmail ...

func (*User) GetById

func (n *User) GetById(userId int64) (user *m.User, err error)

GetById ...

func (*User) GetByNickname added in v0.2.0

func (n *User) GetByNickname(nick string) (user *m.User, err error)

GetByNickname ...

func (*User) GetByResetPassToken

func (n *User) GetByResetPassToken(token string) (user *m.User, err error)

GetByResetPassToken ...

func (*User) List

func (n *User) List(limit, offset int64, orderBy, sort string) (list []*m.User, total int64, err error)

List ...

func (*User) NewToken

func (n *User) NewToken(u *m.User) (token string, err error)

NewToken ...

func (*User) SignIn

func (n *User) SignIn(u *m.User, ipv4 string) (err error)

SignIn ...

func (*User) Update

func (n *User) Update(user *m.User) (err error)

Update ...

type UserMeta

type UserMeta struct {
	// contains filtered or unexported fields
}

UserMeta ...

func GetUserMetaAdaptor

func GetUserMetaAdaptor(d *gorm.DB) *UserMeta

GetUserMetaAdaptor ...

func (*UserMeta) UpdateOrCreate

func (n *UserMeta) UpdateOrCreate(meta *m.UserMeta) (id int64, err error)

UpdateOrCreate ...

type Variable

type Variable struct {
	// contains filtered or unexported fields
}

Variable ...

func GetVariableAdaptor

func GetVariableAdaptor(d *gorm.DB) *Variable

GetVariableAdaptor ...

func (*Variable) Add

func (n *Variable) Add(variables *m.Variable) (err error)

Add ...

func (*Variable) Delete

func (n *Variable) Delete(name string) (err error)

Delete ...

func (*Variable) GetAllEnabled

func (n *Variable) GetAllEnabled() (list []*m.Variable, err error)

GetAllEnabled ...

func (*Variable) GetByName

func (n *Variable) GetByName(name string) (variables *m.Variable, err error)

GetByName ...

func (*Variable) List

func (n *Variable) List(limit, offset int64, orderBy, sort string) (list []*m.Variable, total int64, err error)

List ...

func (*Variable) Update

func (n *Variable) Update(variable *m.Variable) (err error)

Update ...

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

Worker ...

func GetWorkerAdaptor

func GetWorkerAdaptor(d *gorm.DB) *Worker

GetWorkerAdaptor ...

func (*Worker) Add

func (n *Worker) Add(worker *m.Worker) (id int64, err error)

Add ...

func (*Worker) Delete

func (n *Worker) Delete(ids []int64) (err error)

Delete ...

func (*Worker) GetAllEnabled

func (n *Worker) GetAllEnabled() (list []*m.Worker, err error)

GetAllEnabled ...

func (*Worker) GetById

func (n *Worker) GetById(workerId int64) (worker *m.Worker, err error)

GetById ...

func (*Worker) List

func (n *Worker) List(limit, offset int64, orderBy, sort string) (list []*m.Worker, total int64, err error)

List ...

func (*Worker) Update

func (n *Worker) Update(worker *m.Worker) (err error)

Update ...

type Workflow

type Workflow struct {
	// contains filtered or unexported fields
}

Workflow ...

func GetWorkflowAdaptor

func GetWorkflowAdaptor(d *gorm.DB) *Workflow

GetWorkflowAdaptor ...

func (*Workflow) Add

func (n *Workflow) Add(workflow *m.Workflow) (id int64, err error)

Add ...

func (*Workflow) AddScript

func (n *Workflow) AddScript(workflow *m.Workflow, script *m.Script) (err error)

AddScript ...

func (*Workflow) Delete

func (n *Workflow) Delete(workflowId int64) (err error)

Delete ...

func (*Workflow) DependencyLoading

func (n *Workflow) DependencyLoading(workflow *m.Workflow) (err error)

DependencyLoading ...

func (*Workflow) GetAllEnabled

func (n *Workflow) GetAllEnabled() (list []*m.Workflow, err error)

GetAllEnabled ...

func (*Workflow) GetById

func (n *Workflow) GetById(workflowId int64) (workflow *m.Workflow, err error)

GetById ...

func (*Workflow) GetByWorkflowScenarioId added in v0.0.25

func (n *Workflow) GetByWorkflowScenarioId(workflowScenarioId int64) (workflow *m.Workflow, err error)

GetByWorkflowScenarioId ...

func (*Workflow) List

func (n *Workflow) List(limit, offset int64, orderBy, sort string, onlyEnabled bool) (list []*m.Workflow, total int64, err error)

List ...

func (*Workflow) RemoveScript

func (n *Workflow) RemoveScript(workflow *m.Workflow, script *m.Script) (err error)

RemoveScript ...

func (*Workflow) Search

func (n *Workflow) Search(query string, limit, offset int) (list []*m.Workflow, total int64, err error)

Search ...

func (*Workflow) SetScenario

func (n *Workflow) SetScenario(workflow *m.Workflow, s interface{}) (err error)

SetScenario ...

func (*Workflow) Update

func (n *Workflow) Update(workflow *m.Workflow) (err error)

Update ...

func (*Workflow) UpdateScripts

func (n *Workflow) UpdateScripts(wf *m.Workflow) (err error)

UpdateScripts ...

type WorkflowScenario

type WorkflowScenario struct {
	// contains filtered or unexported fields
}

WorkflowScenario ...

func GetWorkflowScenarioAdaptor

func GetWorkflowScenarioAdaptor(d *gorm.DB) *WorkflowScenario

GetWorkflowScenarioAdaptor ...

func (*WorkflowScenario) Add

func (n *WorkflowScenario) Add(workflow *m.WorkflowScenario) (id int64, err error)

Add ...

func (*WorkflowScenario) AddScript

func (n *WorkflowScenario) AddScript(workflowScenario *m.WorkflowScenario, script *m.Script) (err error)

AddScript ...

func (*WorkflowScenario) Delete

func (n *WorkflowScenario) Delete(workflowId int64) (err error)

Delete ...

func (*WorkflowScenario) GetById

func (n *WorkflowScenario) GetById(scenarioId int64) (workflow *m.WorkflowScenario, err error)

GetById ...

func (*WorkflowScenario) List

func (n *WorkflowScenario) List(limit, offset int64, orderBy, sort string) (list []*m.WorkflowScenario, total int64, err error)

List ...

func (*WorkflowScenario) ListByWorkflow

func (n *WorkflowScenario) ListByWorkflow(workflowId int64) (list []*m.WorkflowScenario, total int64, err error)

ListByWorkflow ...

func (*WorkflowScenario) RemoveScript

func (n *WorkflowScenario) RemoveScript(workflowScenario *m.WorkflowScenario, script *m.Script) (err error)

RemoveScript ...

func (*WorkflowScenario) Search

func (n *WorkflowScenario) Search(query string, workflowId, limit, offset int) (list []*m.WorkflowScenario, total int64, err error)

Search ...

func (*WorkflowScenario) Update

func (n *WorkflowScenario) Update(workflow *m.WorkflowScenario) (err error)

Update ...

func (*WorkflowScenario) UpdateScripts

func (n *WorkflowScenario) UpdateScripts(wf *m.WorkflowScenario) (err error)

UpdateScripts ...

type Zigbee2mqtt added in v0.1.0

type Zigbee2mqtt struct {
	// contains filtered or unexported fields
}

Zigbee2mqtt ...

func GetZigbee2mqttAdaptor added in v0.1.0

func GetZigbee2mqttAdaptor(d *gorm.DB) *Zigbee2mqtt

GetZigbee2mqttAdaptor ...

func (*Zigbee2mqtt) Add added in v0.1.0

func (n *Zigbee2mqtt) Add(ver *m.Zigbee2mqtt) (id int64, err error)

Add ...

func (*Zigbee2mqtt) Delete added in v0.1.0

func (n *Zigbee2mqtt) Delete(id int64) (err error)

Delete ...

func (*Zigbee2mqtt) GetById added in v0.1.0

func (n *Zigbee2mqtt) GetById(id int64) (ver *m.Zigbee2mqtt, err error)

GetById ...

func (*Zigbee2mqtt) GetByLogin added in v0.1.0

func (a *Zigbee2mqtt) GetByLogin(login string) (ver *m.Zigbee2mqtt, err error)

GetByLogin ...

func (*Zigbee2mqtt) List added in v0.1.0

func (n *Zigbee2mqtt) List(limit, offset int64) (list []*m.Zigbee2mqtt, total int64, err error)

List ...

func (*Zigbee2mqtt) Update added in v0.1.0

func (n *Zigbee2mqtt) Update(ver *m.Zigbee2mqtt) (err error)

Update ...

type Zigbee2mqttDevice added in v0.1.0

type Zigbee2mqttDevice struct {
	// contains filtered or unexported fields
}

Zigbee2mqttDevice ...

func GetZigbee2mqttDeviceAdaptor added in v0.1.0

func GetZigbee2mqttDeviceAdaptor(d *gorm.DB) *Zigbee2mqttDevice

GetZigbee2mqttDeviceAdaptor ...

func (*Zigbee2mqttDevice) Add added in v0.1.0

func (n *Zigbee2mqttDevice) Add(ver *m.Zigbee2mqttDevice) (err error)

Add ...

func (*Zigbee2mqttDevice) Delete added in v0.1.0

func (n *Zigbee2mqttDevice) Delete(id string) (err error)

Delete ...

func (*Zigbee2mqttDevice) GetById added in v0.1.0

func (n *Zigbee2mqttDevice) GetById(id string) (ver *m.Zigbee2mqttDevice, err error)

GetById ...

func (*Zigbee2mqttDevice) List added in v0.1.0

func (n *Zigbee2mqttDevice) List(limit, offset int64) (list []*m.Zigbee2mqttDevice, total int64, err error)

List ...

func (*Zigbee2mqttDevice) Search added in v0.1.0

func (n *Zigbee2mqttDevice) Search(query string, limit, offset int) (list []*m.Zigbee2mqttDevice, total int64, err error)

Search ...

func (*Zigbee2mqttDevice) Update added in v0.1.0

func (n *Zigbee2mqttDevice) Update(ver *m.Zigbee2mqttDevice) (err error)

Update ...

Jump to

Keyboard shortcuts

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