dto

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMetric

func AddMetric(objects []stub.ApiMetric) (metrics []*m.Metric)

func AttributeFromApi

func AttributeFromApi(apiAttr map[string]stub.ApiAttribute) (attributes m.Attributes)

AttributeFromApi ...

func AttributeToApi

func AttributeToApi(attributes m.Attributes) (apiAttr map[string]stub.ApiAttribute)

AttributeToApi ...

func GetStatistic

func GetStatistic(statistic []*m.Statistic) (result stub.ApiStatistics)

func GetStubArea

func GetStubArea(area *models.Area) (obj *stub.ApiArea)

GetStubArea ...

func GetStubScript

func GetStubScript(script *m.Script) (result *stub.ApiScript)

GetStubScript ...

func GetStubScriptShort

func GetStubScriptShort(script *m.Script) (result *stub.ApiScript)

GetStubScriptShort ...

func ImportArea

func ImportArea(from *stub.ApiArea) (*int64, *models.Area)

func ImportDashboard

func ImportDashboard(obj *stub.ApiDashboard) (ver *models.Dashboard)

ImportDashboard ...

func ImportDashboardCard

func ImportDashboardCard(obj *stub.ApiDashboardCard) (ver *models.DashboardCard)

func ImportDashboardCardItem

func ImportDashboardCardItem(obj *stub.ApiDashboardCardItem) (ver *m.DashboardCardItem)

func ImportDashboardTab

func ImportDashboardTab(obj *stub.ApiDashboardTab) (ver *models.DashboardTab)

func ImportImage

func ImportImage(from *stub.ApiImage) (*int64, *m.Image)

func ImportScript

func ImportScript(from *stub.ApiScript) (*int64, *m.Script)

func Metric

func Metric(metric *m.Metric) (object *stub.ApiMetric)

func Metrics

func Metrics(metrics []*m.Metric) (objects []stub.ApiMetric)

func ToAction

func ToAction(action *m.Action) (obj stub.ApiAction)

ToAction ...

func ToCondition

func ToCondition(cond *m.Condition) (obj *stub.ApiCondition)

ToCondition ...

func ToDashboard

func ToDashboard(ver *models.Dashboard) (obj *stub.ApiDashboard)

ToDashboard ...

func ToDashboardCard

func ToDashboardCard(ver *models.DashboardCard) (obj *stub.ApiDashboardCard)

ToDashboardCard ...

func ToDashboardCardItem

func ToDashboardCardItem(ver *m.DashboardCardItem) (obj *stub.ApiDashboardCardItem)

ToDashboardCardItem ...

func ToDashboardShort

func ToDashboardShort(ver *models.Dashboard) (obj *stub.ApiDashboardShort)

ToDashboardShort ...

func ToDashboardTab

func ToDashboardTab(ver *models.DashboardTab) (obj *stub.ApiDashboardTab)

ToDashboardTab ...

func ToDashboardTabShort

func ToDashboardTabShort(ver *models.DashboardTab) (obj *stub.ApiDashboardTab)

ToDashboardTabShort ...

func ToEntity

func ToEntity(entity *models.Entity) (obj *stub.ApiEntity)

ToEntity ...

func ToLog

func ToLog(log *m.Log) (obj *stub.ApiLog)

ToLog ...

func ToMessage

func ToMessage(message *models.Message) (obj stub.ApiMessage)

func ToTrigger

func ToTrigger(trigger *m.Trigger) (obj *stub.ApiTrigger)

ToTrigger ...

func ToVariable

func ToVariable(ver models.Variable) (obj *stub.ApiVariable)

ToVariable ...

Types

type Action

type Action struct{}

Action ...

func NewActionDto

func NewActionDto() Action

NewActionDto ...

func (Action) Add

func (r Action) Add(from *stub.ApiNewActionRequest) (action *m.Action)

Add ...

func (Action) ToAction

func (r Action) ToAction(action *m.Action) (obj stub.ApiAction)

ToAction ...

func (Action) ToListResult

func (r Action) ToListResult(list []*m.Action) []stub.ApiAction

ToListResult ...

func (Action) ToSearchResult

func (r Action) ToSearchResult(list []*m.Action) *stub.ApiSearchActionResult

ToSearchResult ...

func (Action) Update

func (r Action) Update(from *stub.ActionServiceUpdateActionJSONBody, id int64) (action *m.Action)

Update ...

type Area

type Area struct{}

Area ...

func NewAreaDto

func NewAreaDto() Area

NewAreaDto ...

func (Area) AddArea

func (r Area) AddArea(from *stub.ApiNewAreaRequest) (area *models.Area)

AddArea ...

func (Area) ToListResult

func (r Area) ToListResult(list []*models.Area) []stub.ApiArea

ToListResult ...

func (Area) ToSearchResult

func (r Area) ToSearchResult(list []*models.Area) stub.ApiSearchAreaResult

ToSearchResult ...

func (Area) UpdateArea

func (r Area) UpdateArea(from *stub.AreaServiceUpdateAreaJSONBody, id int64) (area *models.Area)

UpdateArea ...

type Automation

type Automation struct{}

Automation ...

func NewAutomationDto

func NewAutomationDto() Automation

NewAutomationDto ...

func (Automation) AddTask

func (r Automation) AddTask(obj *stub.ApiNewTaskRequest) (task *m.NewTask)

AddTask ...

func (Automation) GetTask

func (r Automation) GetTask(task *m.Task) (obj *stub.ApiTask)

GetTask ...

func (Automation) ToListResult

func (r Automation) ToListResult(list []*m.Task) []*stub.ApiTask

ToListResult ...

func (Automation) UpdateTask

func (r Automation) UpdateTask(obj *stub.AutomationServiceUpdateTaskJSONBody, id int64) (task *m.UpdateTask)

UpdateTask ...

type Backup

type Backup struct{}

Backup ...

func NewBackupDto

func NewBackupDto() Backup

NewBackupDto ...

func (*Backup) ToBackupListResult

func (b *Backup) ToBackupListResult(images []*m.Backup) []*stub.ApiBackup

type Condition

type Condition struct{}

Condition ...

func NewConditionDto

func NewConditionDto() Condition

NewConditionDto ...

func (Condition) AddCondition

func (r Condition) AddCondition(from *stub.ApiNewConditionRequest) (action *m.Condition)

AddCondition ...

func (Condition) ToListResult

func (r Condition) ToListResult(list []*m.Condition) []*stub.ApiCondition

ToListResult ...

func (Condition) ToSearchResult

func (r Condition) ToSearchResult(list []*m.Condition) *stub.ApiSearchConditionResult

ToSearchResult ...

func (Condition) UpdateCondition

func (r Condition) UpdateCondition(from *stub.ConditionServiceUpdateConditionJSONBody, id int64) (action *m.Condition)

UpdateCondition ...

type Dashboard

type Dashboard struct{}

Dashboard ...

func NewDashboardDto

func NewDashboardDto() Dashboard

NewDashboardDto ...

func (Dashboard) AddDashboard

func (r Dashboard) AddDashboard(obj *stub.ApiNewDashboardRequest) (ver *models.Dashboard)

func (Dashboard) ToDashboard

func (r Dashboard) ToDashboard(ver *models.Dashboard) (obj *stub.ApiDashboard)

ToDashboard ...

func (Dashboard) ToListResult

func (r Dashboard) ToListResult(list []*models.Dashboard) []*stub.ApiDashboardShort

ToListResult ...

func (Dashboard) ToSearchResult

func (r Dashboard) ToSearchResult(list []*models.Dashboard) *stub.ApiSearchDashboardResult

ToSearchResult ...

func (Dashboard) UpdateDashboard

func (r Dashboard) UpdateDashboard(obj *stub.DashboardServiceUpdateDashboardJSONBody, id int64) (ver *models.Dashboard)

type DashboardCard

type DashboardCard struct{}

DashboardCard ...

func NewDashboardCardDto

func NewDashboardCardDto() DashboardCard

NewDashboardCardDto ...

func (DashboardCard) AddDashboardCard

func (r DashboardCard) AddDashboardCard(obj *stub.ApiNewDashboardCardRequest) (ver *models.DashboardCard)

func (DashboardCard) ToListResult

func (r DashboardCard) ToListResult(list []*models.DashboardCard) []*stub.ApiDashboardCard

ToListResult ...

func (DashboardCard) UpdateDashboardCard

type DashboardCardItem

type DashboardCardItem struct{}

DashboardCardItem ...

func NewDashboardCardItemDto

func NewDashboardCardItemDto() DashboardCardItem

NewDashboardCardItemDto ...

func (DashboardCardItem) AddDashboardCardItem

func (r DashboardCardItem) AddDashboardCardItem(obj *stub.ApiNewDashboardCardItemRequest) (ver *m.DashboardCardItem)

func (DashboardCardItem) ToDashboardCardItem

func (r DashboardCardItem) ToDashboardCardItem(ver *m.DashboardCardItem) (obj *stub.ApiDashboardCardItem)

ToDashboardCardItem ...

func (DashboardCardItem) ToListResult

func (r DashboardCardItem) ToListResult(list []*m.DashboardCardItem) []*stub.ApiDashboardCardItem

ToListResult ...

func (DashboardCardItem) UpdateDashboardCardItem

type DashboardTab

type DashboardTab struct{}

DashboardTab ...

func NewDashboardTabDto

func NewDashboardTabDto() DashboardTab

NewDashboardTabDto ...

func (DashboardTab) AddDashboardTab

func (r DashboardTab) AddDashboardTab(obj *stub.ApiNewDashboardTabRequest) (ver *models.DashboardTab)

func (DashboardTab) ToDashboardTab

func (r DashboardTab) ToDashboardTab(ver *models.DashboardTab) (obj *stub.ApiDashboardTab)

ToDashboardTab ...

func (DashboardTab) ToListResult

func (r DashboardTab) ToListResult(list []*models.DashboardTab) []*stub.ApiDashboardTab

ToListResult ...

func (DashboardTab) UpdateDashboardTab

type DeveloperTools

type DeveloperTools struct {
}

func NewDeveloperToolsDto

func NewDeveloperToolsDto() DeveloperTools

func (DeveloperTools) ToListResult

func (DeveloperTools) ToListResult(state bus.Stats) []*stub.ApiBusStateItem

type Dto

type Dto struct {
	Role              Role
	User              User
	Image             Image
	Script            Script
	Tag               Tag
	Plugin            Plugin
	Entity            Entity
	Zigbee2mqtt       Zigbee2mqtt
	Area              Area
	Action            Action
	Condition         Condition
	Trigger           Trigger
	Automation        Automation
	Log               Log
	Dashboard         Dashboard
	DashboardCard     DashboardCard
	DashboardCardItem DashboardCardItem
	DashboardTab      DashboardTab
	Variable          Variable
	EntityStorage     EntityStorage
	MessageDelivery   MessageDelivery
	DeveloperTools    DeveloperTools
	Mqtt              Mqtt
	Backup            Backup
}

Dto ...

func NewDto

func NewDto() Dto

NewDto ...

type Entity

type Entity struct{}

Entity ...

func NewEntityDto

func NewEntityDto() Entity

NewEntityDto ...

func (Entity) AddEntity

func (r Entity) AddEntity(obj *stub.ApiNewEntityRequest) (entity *models.Entity)

AddEntity ...

func (Entity) ImportEntity

func (r Entity) ImportEntity(from *stub.ApiEntity) (to *models.Entity)

func (Entity) ToEntityShort

func (r Entity) ToEntityShort(entity *models.Entity) (obj *stub.ApiEntityShort)

ToEntityShort ...

func (Entity) ToListResult

func (r Entity) ToListResult(list []*models.Entity) []*stub.ApiEntityShort

ToListResult ...

func (Entity) ToSearchResult

func (r Entity) ToSearchResult(list []*models.Entity) *stub.ApiSearchEntityResult

ToSearchResult ...

func (Entity) UpdateEntity

func (r Entity) UpdateEntity(obj *stub.EntityServiceUpdateEntityJSONBody) (entity *models.Entity)

UpdateEntity ...

type EntityStorage

type EntityStorage struct{}

EntityStorage ...

func NewEntityStorageDto

func NewEntityStorageDto() EntityStorage

NewEntityStorageDto ...

func (EntityStorage) ToListResult

func (_ EntityStorage) ToListResult(list *m.EntityStorageList) []*stub.ApiEntityStorage

type Image

type Image struct{}

Image ...

func NewImageDto

func NewImageDto() Image

NewImageDto ...

func (Image) FromNewImageRequest

func (i Image) FromNewImageRequest(req *stub.ApiNewImageRequest) (image *m.Image)

FromNewImageRequest ...

func (Image) FromUpdateImageRequest

func (i Image) FromUpdateImageRequest(req *stub.ImageServiceUpdateImageByIdJSONBody, id int64) (image *m.Image)

FromUpdateImageRequest ...

func (Image) ToFilterList

func (i Image) ToFilterList(items []*m.ImageFilterList) (result stub.ApiGetImageFilterListResult)

ToFilterList ...

func (Image) ToImage

func (i Image) ToImage(image *m.Image) (result *stub.ApiImage)

ToImage ...

func (Image) ToImageList

func (i Image) ToImageList(items []*m.Image) (result *stub.ApiGetImageListByDateResult)

ToImageList ...

func (Image) ToImageListResult

func (i Image) ToImageListResult(images []*m.Image) []*stub.ApiImage

ToImageListResult ...

func (Image) ToImageShort

func (i Image) ToImageShort(image *m.Image) (result *stub.ApiImage)

ToImageShort ...

type Log

type Log struct{}

Log ...

func NewLogDto

func NewLogDto() Log

NewLogDto ...

func (Log) ToListResult

func (r Log) ToListResult(list []*m.Log) []*stub.ApiLog

ToListResult ...

func (Log) ToLog

func (r Log) ToLog(log *m.Log) (obj *stub.ApiLog)

ToLog ...

type MessageDelivery

type MessageDelivery struct{}

func NewMessageDeliveryDto

func NewMessageDeliveryDto() MessageDelivery

func (MessageDelivery) ToListResult

func (m MessageDelivery) ToListResult(list []*models.MessageDelivery) []*stub.ApiMessageDelivery

func (MessageDelivery) ToMessageDelivery

func (m MessageDelivery) ToMessageDelivery(message *models.MessageDelivery) (obj *stub.ApiMessageDelivery)

type Mqtt

type Mqtt struct{}

Mqtt ...

func NewMqttDto

func NewMqttDto() Mqtt

NewMqttDto ...

func (Mqtt) GetClientById

func (r Mqtt) GetClientById(from *admin2.ClientInfo) (client *stub.ApiClient)

GetClientById ...

func (Mqtt) GetSubscriptionList

func (r Mqtt) GetSubscriptionList(list []*admin2.SubscriptionInfo) []*stub.ApiSubscription

GetSubscriptionList ...

func (Mqtt) GetSubscriptiontById

func (r Mqtt) GetSubscriptiontById(from *admin2.SubscriptionInfo) (client *stub.ApiSubscription)

GetSubscriptiontById ...

func (Mqtt) ToListResult

func (r Mqtt) ToListResult(list []*admin2.ClientInfo) []*stub.ApiClient

ToListResult ...

type Plugin

type Plugin struct{}

Plugin ...

func NewPluginDto

func NewPluginDto() Plugin

NewPluginDto ...

func (Plugin) Options

func (p Plugin) Options(options m.PluginOptions) (result *stub.ApiPluginOptionsResult)

Options ...

func (Plugin) ToGetPlugin

func (p Plugin) ToGetPlugin(plugin *m.Plugin, options m.PluginOptions) (result *stub.ApiPlugin)

func (Plugin) ToPluginListResult

func (p Plugin) ToPluginListResult(plugins []*m.Plugin) []*stub.ApiPluginShort

ToPluginListResult ...

func (Plugin) ToSearchResult

func (p Plugin) ToSearchResult(list []*m.Plugin) *stub.ApiSearchPluginResult

ToSearchResult ...

type Role

type Role struct{}

Role ...

func NewRoleDto

func NewRoleDto() Role

NewRoleDto ...

func (Role) FromNewRoleRequest

func (r Role) FromNewRoleRequest(from *stub.ApiNewRoleRequest) (to *m.Role)

FromNewRoleRequest ...

func (Role) FromUpdateRoleRequest

func (r Role) FromUpdateRoleRequest(from *stub.RoleServiceUpdateRoleByNameJSONBody, name string) (to *m.Role)

FromUpdateRoleRequest ...

func (Role) GetStubRole

func (r Role) GetStubRole(from *m.Role) (to stub.ApiRole)

GetStubRole ...

func (Role) ToAccessListResult

func (r Role) ToAccessListResult(accessList *access_list.AccessList) *stub.ApiAccessList

ToAccessListResult ...

func (Role) ToListResult

func (r Role) ToListResult(list []*m.Role) []stub.ApiRole

ToListResult ...

func (Role) ToRoleAccessListResult

func (r Role) ToRoleAccessListResult(accessList access_list.AccessList) *stub.ApiRoleAccessListResult

ToRoleAccessListResult ...

func (Role) ToSearchResult

func (r Role) ToSearchResult(list []*m.Role) *stub.ApiSearchRoleListResult

ToSearchResult ...

func (Role) UpdateRoleAccessList

func (r Role) UpdateRoleAccessList(req *stub.RoleServiceUpdateRoleAccessListJSONBody, name string) (accessListDif map[string]map[string]bool)

UpdateRoleAccessList ...

type Script

type Script struct{}

Script ...

func NewScriptDto

func NewScriptDto() Script

NewScriptDto ...

func (Script) FromExecSrcScriptRequest

func (s Script) FromExecSrcScriptRequest(req *stub.ApiExecSrcScriptRequest) (script *m.Script)

FromExecSrcScriptRequest ...

func (Script) FromNewScriptRequest

func (s Script) FromNewScriptRequest(req *stub.ApiNewScriptRequest) (script *m.Script)

FromNewScriptRequest ...

func (Script) FromUpdateScriptRequest

func (s Script) FromUpdateScriptRequest(req *stub.ScriptServiceUpdateScriptByIdJSONBody, id int64) (script *m.Script)

FromUpdateScriptRequest ...

func (Script) GetStubScript

func (s Script) GetStubScript(script *m.Script) (result *stub.ApiScript)

GetStubScript ...

func (Script) GetStubScriptShort

func (s Script) GetStubScriptShort(script *m.Script) (result *stub.ApiScript)

GetStubScriptShort ...

func (Script) ToListResult

func (s Script) ToListResult(list []*m.Script) []*stub.ApiScript

ToListResult ...

func (Script) ToSearchResult

func (s Script) ToSearchResult(list []*m.Script) *stub.ApiSearchScriptListResult

ToSearchResult ...

type Tag

type Tag struct{}

Tag ...

func NewTagDto

func NewTagDto() Tag

NewTagDto ...

func (Tag) ToListResult

func (s Tag) ToListResult(list []*m.Tag) []*stub.ApiTag

ToListResult ...

func (Tag) ToSearchResult

func (s Tag) ToSearchResult(list []*m.Tag) *stub.ApiSearchTagListResult

ToSearchResult ...

type Trigger

type Trigger struct{}

Trigger ...

func NewTriggerDto

func NewTriggerDto() Trigger

NewTriggerDto ...

func (Trigger) AddTrigger

func (r Trigger) AddTrigger(from *stub.ApiNewTriggerRequest) (action *m.NewTrigger)

AddTrigger ...

func (Trigger) ToListResult

func (r Trigger) ToListResult(list []*m.Trigger) []*stub.ApiTrigger

ToListResult ...

func (Trigger) ToSearchResult

func (r Trigger) ToSearchResult(list []*m.Trigger) *stub.ApiSearchTriggerResult

ToSearchResult ...

func (Trigger) ToTrigger

func (r Trigger) ToTrigger(action *m.Trigger) (obj *stub.ApiTrigger)

ToTrigger ...

func (Trigger) UpdateTrigger

func (r Trigger) UpdateTrigger(from *stub.TriggerServiceUpdateTriggerJSONBody, id int64) (action *m.UpdateTrigger)

UpdateTrigger ...

type User

type User struct{}

User ...

func NewUserDto

func NewUserDto() User

NewUserDto ...

func (User) AddUserRequest

func (u User) AddUserRequest(req *stub.ApiNewtUserRequest) (user *m.User)

AddUserRequest ...

func (User) ToListResult

func (u User) ToListResult(list []*m.User) []*stub.ApiUserShot

ToListResult ...

func (User) ToUserFull

func (u User) ToUserFull(user *m.User) (result *stub.ApiUserFull)

ToUserFull ...

func (User) ToUserShot

func (u User) ToUserShot(user *m.User) (result *stub.ApiUserShot)

ToUserShot ...

func (User) UpdateUserByIdRequest

func (u User) UpdateUserByIdRequest(req *stub.UserServiceUpdateUserByIdJSONBody, id int64) (user *m.User)

UpdateUserByIdRequest ...

type Variable

type Variable struct{}

Variable ...

func NewVariableDto

func NewVariableDto() Variable

NewVariableDto ...

func (Variable) AddVariable

func (r Variable) AddVariable(from *stub.ApiNewVariableRequest) (ver models.Variable)

AddVariable ...

func (Variable) ToListResult

func (r Variable) ToListResult(list []models.Variable) []*stub.ApiVariable

ToListResult ...

func (Variable) ToSearchResult

func (r Variable) ToSearchResult(list []models.Variable) *stub.ApiSearchVariableResult

ToSearchResult ...

func (Variable) ToVariable

func (r Variable) ToVariable(ver models.Variable) (obj *stub.ApiVariable)

ToVariable ...

func (Variable) UpdateVariable

func (r Variable) UpdateVariable(obj *stub.VariableServiceUpdateVariableJSONBody, name string) (ver models.Variable)

UpdateVariable ...

type Zigbee2mqtt

type Zigbee2mqtt struct{}

Zigbee2mqtt ...

func NewZigbee2mqttDto

func NewZigbee2mqttDto() Zigbee2mqtt

NewZigbee2mqttDto ...

func (Zigbee2mqtt) AddZigbee2MqttBridgeRequest

func (u Zigbee2mqtt) AddZigbee2MqttBridgeRequest(obj *stub.ApiNewZigbee2mqttRequest) (bridge *models.Zigbee2mqtt)

AddZigbee2MqttBridgeRequest ...

func (Zigbee2mqtt) AddZigbee2MqttBridgeResult

func (u Zigbee2mqtt) AddZigbee2MqttBridgeResult(bridge *models.Zigbee2mqtt) (obj stub.ApiZigbee2mqtt)

AddZigbee2MqttBridgeResult ...

func (Zigbee2mqtt) GetBridgeListResult

func (u Zigbee2mqtt) GetBridgeListResult(list []*models.Zigbee2mqtt) []*stub.ApiZigbee2mqttShort

GetBridgeListResult ...

func (Zigbee2mqtt) SearchDevice

func (u Zigbee2mqtt) SearchDevice(list []*models.Zigbee2mqttDevice) (obj *stub.ApiSearchDeviceResult)

SearchDevice ...

func (Zigbee2mqtt) ToListResult

func (u Zigbee2mqtt) ToListResult(list []*models.Zigbee2mqttDevice) []*stub.ApiZigbee2mqttDevice

ToListResult ...

func (Zigbee2mqtt) ToZigbee2MqttDevice

func (u Zigbee2mqtt) ToZigbee2MqttDevice(device *models.Zigbee2mqttDevice) (obj *stub.ApiZigbee2mqttDevice)

ToZigbee2MqttDevice ...

func (Zigbee2mqtt) ToZigbee2mqttInfo

func (u Zigbee2mqtt) ToZigbee2mqttInfo(bridge *models.Zigbee2mqtt) (obj *stub.ApiZigbee2mqtt)

ToZigbee2mqttInfo ...

func (Zigbee2mqtt) UpdateBridgeByIdRequest

func (u Zigbee2mqtt) UpdateBridgeByIdRequest(obj *stub.Zigbee2mqttServiceUpdateBridgeByIdJSONBody, id int64) (bridge *models.Zigbee2mqtt)

UpdateBridgeByIdRequest ...

func (Zigbee2mqtt) UpdateBridgeByIdResult

func (u Zigbee2mqtt) UpdateBridgeByIdResult(bridge *models.Zigbee2mqtt) (obj *stub.ApiZigbee2mqtt)

UpdateBridgeByIdResult ...

Jump to

Keyboard shortcuts

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