dto

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMetric added in v0.6.0

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

func AttributeFromApi added in v0.5.1

func AttributeFromApi(apiAttr map[string]*api.Attribute) (attributes m.Attributes)

AttributeFromApi ...

func AttributeToApi added in v0.5.1

func AttributeToApi(attributes m.Attributes) (apiAttr map[string]*api.Attribute)

AttributeToApi ...

func ImportArea added in v0.7.2

func ImportArea(from *api.Area) (*int64, *m.Area)

func ImportDashboard added in v0.6.0

func ImportDashboard(obj *api.Dashboard) (ver *m.Dashboard)

ImportDashboard ...

func ImportDashboardCard added in v0.6.0

func ImportDashboardCard(obj *api.DashboardCard) (ver *m.DashboardCard)

func ImportDashboardCardItem added in v0.6.0

func ImportDashboardCardItem(obj *api.DashboardCardItem) (ver *m.DashboardCardItem)

func ImportDashboardTab added in v0.6.0

func ImportDashboardTab(obj *api.DashboardTab) (ver *m.DashboardTab)

func ImportImage added in v0.7.2

func ImportImage(from *api.Image) (*int64, *m.Image)

func ImportScript added in v0.7.2

func ImportScript(from *api.Script) (*int64, *m.Script)

func Metric added in v0.7.0

func Metric(metric *m.Metric) (object *api.Metric)

func Metrics added in v0.6.0

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

func ToArea added in v0.5.2

func ToArea(area *m.Area) (obj *api.Area)

ToArea ...

func ToDashboard added in v0.6.0

func ToDashboard(ver *m.Dashboard) (obj *api.Dashboard)

ToDashboard ...

func ToDashboardCard added in v0.6.0

func ToDashboardCard(ver *m.DashboardCard) (obj *api.DashboardCard)

ToDashboardCard ...

func ToDashboardCardItem added in v0.6.0

func ToDashboardCardItem(ver *m.DashboardCardItem) (obj *api.DashboardCardItem)

ToDashboardCardItem ...

func ToDashboardShort added in v0.6.0

func ToDashboardShort(ver *m.Dashboard) (obj *api.DashboardShort)

ToDashboardShort ...

func ToDashboardTab added in v0.6.0

func ToDashboardTab(ver *m.DashboardTab) (obj *api.DashboardTab)

ToDashboardTab ...

func ToDashboardTabShort added in v0.6.0

func ToDashboardTabShort(ver *m.DashboardTab) (obj *api.DashboardTabShort)

ToDashboardTabShort ...

func ToEntity added in v0.5.2

func ToEntity(entity *m.Entity) (obj *api.Entity)

ToEntity ...

func ToGScript added in v0.5.2

func ToGScript(script *m.Script) (result *api.Script)

ToGScript ...

func ToLog added in v0.5.3

func ToLog(log *m.Log) (obj *api.Log)

ToLog ...

func ToMessage added in v0.10.0

func ToMessage(message *m.Message) (obj *api.Message)

func ToVariable added in v0.6.0

func ToVariable(ver m.Variable) (obj *api.Variable)

ToVariable ...

Types

type Area added in v0.5.2

type Area struct{}

Area ...

func NewAreaDto added in v0.5.2

func NewAreaDto() Area

NewAreaDto ...

func (Area) AddArea added in v0.5.2

func (r Area) AddArea(from *api.NewAreaRequest) (area *m.Area)

AddArea ...

func (Area) ToArea added in v0.5.2

func (r Area) ToArea(area *m.Area) (obj *api.Area)

ToArea ...

func (Area) ToListResult added in v0.5.2

func (r Area) ToListResult(list []*m.Area, total uint64, pagination common.PageParams) *api.GetAreaListResult

ToListResult ...

func (Area) ToSearchResult added in v0.5.2

func (r Area) ToSearchResult(list []*m.Area) *api.SearchAreaResult

ToSearchResult ...

func (Area) UpdateArea added in v0.5.2

func (r Area) UpdateArea(obj *api.UpdateAreaRequest) (area *m.Area)

UpdateArea ...

type Automation added in v0.5.2

type Automation struct{}

Automation ...

func NewAutomationDto added in v0.5.2

func NewAutomationDto() Automation

NewAutomationDto ...

func (Automation) AddTask added in v0.5.2

func (r Automation) AddTask(obj *api.NewTaskRequest) (task *m.Task)

AddTask ...

func (Automation) GetTask added in v0.11.0

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

GetTask ...

func (Automation) GetTaskList added in v0.11.0

func (r Automation) GetTaskList(list []*m.Task, total uint64, pagination common.PageParams) *api.GetTaskListResult

GetTaskList ...

func (Automation) ImportTask added in v0.11.0

func (r Automation) ImportTask(obj *api.NewTaskRequest) (task *m.Task)

ImportTask ...

func (Automation) UpdateTask added in v0.5.2

func (r Automation) UpdateTask(obj *api.UpdateTaskRequest) (task *m.Task)

UpdateTask ...

type Dashboard added in v0.6.0

type Dashboard struct{}

Dashboard ...

func NewDashboardDto added in v0.6.0

func NewDashboardDto() Dashboard

NewDashboardDto ...

func (Dashboard) AddDashboard added in v0.6.0

func (r Dashboard) AddDashboard(obj *api.NewDashboardRequest) (ver *m.Dashboard)

func (Dashboard) ToDashboard added in v0.6.0

func (r Dashboard) ToDashboard(ver *m.Dashboard) (obj *api.Dashboard)

ToDashboard ...

func (Dashboard) ToListResult added in v0.6.0

func (r Dashboard) ToListResult(list []*m.Dashboard, total uint64, pagination common.PageParams) *api.GetDashboardListResult

ToListResult ...

func (Dashboard) ToSearchResult added in v0.7.0

func (r Dashboard) ToSearchResult(list []*m.Dashboard) *api.SearchDashboardResult

ToSearchResult ...

func (Dashboard) UpdateDashboard added in v0.6.0

func (r Dashboard) UpdateDashboard(obj *api.UpdateDashboardRequest) (ver *m.Dashboard)

type DashboardCard added in v0.6.0

type DashboardCard struct{}

DashboardCard ...

func NewDashboardCardDto added in v0.6.0

func NewDashboardCardDto() DashboardCard

NewDashboardCardDto ...

func (DashboardCard) AddDashboardCard added in v0.6.0

func (r DashboardCard) AddDashboardCard(obj *api.NewDashboardCardRequest) (ver *m.DashboardCard)

func (DashboardCard) ToDashboardCard added in v0.6.0

func (r DashboardCard) ToDashboardCard(ver *m.DashboardCard) (obj *api.DashboardCard)

ToDashboardCard ...

func (DashboardCard) ToListResult added in v0.6.0

func (r DashboardCard) ToListResult(list []*m.DashboardCard, total uint64, pagination common.PageParams) *api.GetDashboardCardListResult

ToListResult ...

func (DashboardCard) UpdateDashboardCard added in v0.6.0

func (r DashboardCard) UpdateDashboardCard(obj *api.UpdateDashboardCardRequest) (ver *m.DashboardCard)

type DashboardCardItem added in v0.6.0

type DashboardCardItem struct{}

DashboardCardItem ...

func NewDashboardCardItemDto added in v0.6.0

func NewDashboardCardItemDto() DashboardCardItem

NewDashboardCardItemDto ...

func (DashboardCardItem) AddDashboardCardItem added in v0.6.0

func (r DashboardCardItem) AddDashboardCardItem(obj *api.NewDashboardCardItemRequest) (ver *m.DashboardCardItem)

func (DashboardCardItem) ToDashboardCardItem added in v0.6.0

func (r DashboardCardItem) ToDashboardCardItem(ver *m.DashboardCardItem) (obj *api.DashboardCardItem)

ToDashboardCardItem ...

func (DashboardCardItem) ToListResult added in v0.6.0

func (r DashboardCardItem) ToListResult(list []*m.DashboardCardItem, total uint64, pagination common.PageParams) *api.GetDashboardCardItemListResult

ToListResult ...

func (DashboardCardItem) UpdateDashboardCardItem added in v0.6.0

func (r DashboardCardItem) UpdateDashboardCardItem(obj *api.UpdateDashboardCardItemRequest) (ver *m.DashboardCardItem)

type DashboardTab added in v0.6.0

type DashboardTab struct{}

DashboardTab ...

func NewDashboardTabDto added in v0.6.0

func NewDashboardTabDto() DashboardTab

NewDashboardTabDto ...

func (DashboardTab) AddDashboardTab added in v0.6.0

func (r DashboardTab) AddDashboardTab(obj *api.NewDashboardTabRequest) (ver *m.DashboardTab)

func (DashboardTab) ToDashboardTab added in v0.6.0

func (r DashboardTab) ToDashboardTab(ver *m.DashboardTab) (obj *api.DashboardTab)

ToDashboardTab ...

func (DashboardTab) ToListResult added in v0.6.0

func (r DashboardTab) ToListResult(list []*m.DashboardTab, total uint64, pagination common.PageParams) *api.GetDashboardTabListResult

ToListResult ...

func (DashboardTab) UpdateDashboardTab added in v0.6.0

func (r DashboardTab) UpdateDashboardTab(obj *api.UpdateDashboardTabRequest) (ver *m.DashboardTab)

type Dto

type Dto struct {
	Role              Role
	User              User
	Image             Image
	Script            Script
	Plugin            Plugin
	Entity            Entity
	Zigbee2mqtt       Zigbee2mqtt
	Area              Area
	Automation        Automation
	Log               Log
	Dashboard         Dashboard
	DashboardCard     DashboardCard
	DashboardCardItem DashboardCardItem
	DashboardTab      DashboardTab
	Variable          Variable
	EntityStorage     EntityStorage
	MessageDelivery   MessageDelivery
}

Dto ...

func NewDto

func NewDto() Dto

NewDto ...

type Entity added in v0.5.1

type Entity struct{}

Entity ...

func NewEntityDto added in v0.5.1

func NewEntityDto() Entity

NewEntityDto ...

func (Entity) AddEntity added in v0.5.2

func (r Entity) AddEntity(obj *api.NewEntityRequest) (entity *m.Entity)

AddEntity ...

func (Entity) ImportEntity added in v0.7.2

func (r Entity) ImportEntity(from *api.Entity) (to *m.Entity)

func (Entity) ToEntity added in v0.5.2

func (r Entity) ToEntity(entity *m.Entity) (obj *api.Entity)

ToEntity ...

func (Entity) ToEntityShort added in v0.5.2

func (r Entity) ToEntityShort(entity *m.Entity) (obj *api.EntityShort)

ToEntityShort ...

func (Entity) ToListResult added in v0.5.2

func (r Entity) ToListResult(list []*m.Entity, total uint64, pagination common.PageParams) *api.GetEntityListResult

ToListResult ...

func (Entity) ToSearchResult added in v0.5.2

func (r Entity) ToSearchResult(list []*m.Entity) *api.SearchEntityResult

ToSearchResult ...

func (Entity) UpdateEntity added in v0.5.2

func (r Entity) UpdateEntity(obj *api.UpdateEntityRequest) (entity *m.Entity)

UpdateEntity ...

type EntityStorage added in v0.6.0

type EntityStorage struct{}

EntityStorage ...

func NewEntityStorageDto added in v0.6.0

func NewEntityStorageDto() EntityStorage

NewEntityStorageDto ...

func (EntityStorage) List added in v0.6.0

func (_ EntityStorage) List(list []*m.EntityStorage, total uint64, pagination common.PageParams, entity *m.Entity) (result *api.GetEntityStorageResult)

type Image

type Image struct{}

Image ...

func NewImageDto

func NewImageDto() Image

NewImageDto ...

func (Image) FromNewImageRequest

func (i Image) FromNewImageRequest(req *api.NewImageRequest) (image *m.Image)

FromNewImageRequest ...

func (Image) FromUpdateImageRequest

func (i Image) FromUpdateImageRequest(req *api.UpdateImageRequest) (image *m.Image)

FromUpdateImageRequest ...

func (Image) ToFilterList added in v0.5.3

func (i Image) ToFilterList(items []*m.ImageFilterList) (result *api.GetImageFilterListResult)

ToFilterList ...

func (Image) ToImage

func (i Image) ToImage(image *m.Image) (result *api.Image)

ToImage ...

func (Image) ToImageList added in v0.5.3

func (i Image) ToImageList(items []*m.Image) (result *api.GetImageListByDateResult)

ToImageList ...

func (Image) ToImageListResult

func (i Image) ToImageListResult(items []*m.Image, total uint64, pagination common.PageParams) (result *api.GetImageListResult)

ToImageListResult ...

type Log added in v0.5.3

type Log struct{}

Log ...

func NewLogDto added in v0.5.3

func NewLogDto() Log

NewLogDto ...

func (Log) ToListResult added in v0.5.3

func (r Log) ToListResult(list []*m.Log, total uint64, pagination common.PageParams) *api.GetLogListResult

ToListResult ...

func (Log) ToLog added in v0.5.3

func (r Log) ToLog(log *m.Log) (obj *api.Log)

ToLog ...

type MessageDelivery added in v0.10.0

type MessageDelivery struct{}

func NewMessageDeliveryDto added in v0.10.0

func NewMessageDeliveryDto() MessageDelivery

func (MessageDelivery) ToListResult added in v0.10.0

func (m MessageDelivery) ToListResult(list []*m.MessageDelivery, total uint64, pagination common.PageParams) *api.GetMessageDeliveryListResult

func (MessageDelivery) ToMessageDelivery added in v0.10.0

func (m MessageDelivery) ToMessageDelivery(message *m.MessageDelivery) (obj *api.MessageDelivery)

type Plugin added in v0.5.1

type Plugin struct{}

Plugin ...

func NewPluginDto added in v0.5.1

func NewPluginDto() Plugin

NewPluginDto ...

func (Plugin) Options added in v0.5.1

func (p Plugin) Options(options m.PluginOptions) (result *api.PluginOptionsResult)

Options ...

func (Plugin) ToGetPlugin added in v0.10.2

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

func (Plugin) ToPluginListResult added in v0.5.1

func (p Plugin) ToPluginListResult(items []m.Plugin, total uint64, pagination common.PageParams) (result *api.GetPluginListResult)

ToPluginListResult ...

func (Plugin) ToSearchResult added in v0.5.2

func (p Plugin) ToSearchResult(list []m.Plugin) *api.SearchPluginResult

ToSearchResult ...

type Role

type Role struct{}

Role ...

func NewRoleDto

func NewRoleDto() Role

NewRoleDto ...

func (Role) FromNewRoleRequest

func (r Role) FromNewRoleRequest(from *api.NewRoleRequest) (to *m.Role)

FromNewRoleRequest ...

func (Role) FromUpdateRoleAccessListRequest

func (r Role) FromUpdateRoleAccessListRequest(req *api.UpdateRoleAccessListRequest) (accessListDif map[string]map[string]bool)

FromUpdateRoleAccessListRequest ...

func (Role) FromUpdateRoleRequest

func (r Role) FromUpdateRoleRequest(from *api.UpdateRoleRequest) (to *m.Role)

FromUpdateRoleRequest ...

func (Role) ToAccessListResult added in v0.5.2

func (r Role) ToAccessListResult(accessList access_list.AccessList) *api.AccessList

ToAccessListResult ...

func (Role) ToGRole

func (r Role) ToGRole(from *m.Role) (to *api.Role)

ToGRole ...

func (Role) ToListResult

func (r Role) ToListResult(list []*m.Role, total uint64, pagination common.PageParams) *api.GetRoleListResult

ToListResult ...

func (Role) ToRoleAccessListResult

func (r Role) ToRoleAccessListResult(accessList access_list.AccessList) *api.RoleAccessListResult

ToRoleAccessListResult ...

func (Role) ToSearchResult

func (r Role) ToSearchResult(list []*m.Role) *api.SearchRoleListResult

ToSearchResult ...

type Script

type Script struct{}

Script ...

func NewScriptDto

func NewScriptDto() Script

NewScriptDto ...

func (Script) FromExecSrcScriptRequest

func (s Script) FromExecSrcScriptRequest(req *api.ExecSrcScriptRequest) (script *m.Script)

FromExecSrcScriptRequest ...

func (Script) FromNewScriptRequest

func (s Script) FromNewScriptRequest(req *api.NewScriptRequest) (script *m.Script)

FromNewScriptRequest ...

func (Script) FromUpdateScriptRequest

func (s Script) FromUpdateScriptRequest(req *api.UpdateScriptRequest) (script *m.Script)

FromUpdateScriptRequest ...

func (Script) ToGScript

func (s Script) ToGScript(script *m.Script) (result *api.Script)

ToGScript ...

func (Script) ToListResult

func (s Script) ToListResult(list []*m.Script, total uint64, pagination common.PageParams) *api.GetScriptListResult

ToListResult ...

func (Script) ToSearchResult

func (s Script) ToSearchResult(list []*m.Script) *api.SearchScriptListResult

ToSearchResult ...

type User

type User struct{}

User ...

func NewUserDto

func NewUserDto() User

NewUserDto ...

func (User) FromAddUser

func (u User) FromAddUser(req *api.NewtUserRequest) (user *m.User)

FromAddUser ...

func (User) FromUpdateUserRequest

func (u User) FromUpdateUserRequest(req *api.UpdateUserRequest) (user *m.User)

FromUpdateUserRequest ...

func (User) ToListResult

func (u User) ToListResult(list []*m.User, total uint64, pagination common.PageParams) *api.GetUserListResult

ToListResult ...

func (User) ToUserFull

func (u User) ToUserFull(user *m.User) (result *api.UserFull)

ToUserFull ...

func (User) ToUserShot

func (u User) ToUserShot(user *m.User) (result *api.UserShot)

ToUserShot ...

type Variable added in v0.6.0

type Variable struct{}

Variable ...

func NewVariableDto added in v0.6.0

func NewVariableDto() Variable

NewVariableDto ...

func (Variable) AddVariable added in v0.6.0

func (r Variable) AddVariable(from *api.NewVariableRequest) (ver m.Variable)

AddVariable ...

func (Variable) ToListResult added in v0.6.0

func (r Variable) ToListResult(list []m.Variable, total uint64, pagination common.PageParams) *api.GetVariableListResult

ToListResult ...

func (Variable) ToVariable added in v0.6.0

func (r Variable) ToVariable(ver m.Variable) (obj *api.Variable)

ToVariable ...

func (Variable) UpdateVariable added in v0.6.0

func (r Variable) UpdateVariable(obj *api.UpdateVariableRequest) (ver m.Variable)

UpdateVariable ...

type Zigbee2mqtt added in v0.5.2

type Zigbee2mqtt struct{}

Zigbee2mqtt ...

func NewZigbee2mqttDto added in v0.5.2

func NewZigbee2mqttDto() Zigbee2mqtt

NewZigbee2mqttDto ...

func (Zigbee2mqtt) AddZigbee2MqttBridgeRequest added in v0.5.2

func (u Zigbee2mqtt) AddZigbee2MqttBridgeRequest(obj *api.NewZigbee2MqttRequest) (bridge *m.Zigbee2mqtt)

AddZigbee2MqttBridgeRequest ...

func (Zigbee2mqtt) AddZigbee2MqttBridgeResult added in v0.5.2

func (u Zigbee2mqtt) AddZigbee2MqttBridgeResult(bridge *m.Zigbee2mqtt) (obj *api.Zigbee2Mqtt)

AddZigbee2MqttBridgeResult ...

func (Zigbee2mqtt) GetBridgeListResult added in v0.5.2

func (u Zigbee2mqtt) GetBridgeListResult(list []*zigbee2mqtt.Zigbee2mqttBridge, total uint64, pagination common.PageParams) (obj *api.GetBridgeListResult)

GetBridgeListResult ...

func (Zigbee2mqtt) SearchDevice added in v0.5.2

func (u Zigbee2mqtt) SearchDevice(list []*m.Zigbee2mqttDevice) (obj *api.SearchDeviceResult)

SearchDevice ...

func (Zigbee2mqtt) ToListResult added in v0.5.2

func (u Zigbee2mqtt) ToListResult(list []*m.Zigbee2mqttDevice, total uint64, pagination common.PageParams) *api.DeviceListResult

ToListResult ...

func (Zigbee2mqtt) ToZigbee2MqttDevice added in v0.5.2

func (u Zigbee2mqtt) ToZigbee2MqttDevice(device *m.Zigbee2mqttDevice) (obj *api.Zigbee2MqttDevice)

ToZigbee2MqttDevice ...

func (Zigbee2mqtt) ToZigbee2mqttInfo added in v0.5.2

func (u Zigbee2mqtt) ToZigbee2mqttInfo(info *zigbee2mqtt.Zigbee2mqttBridge) (obj *api.Zigbee2Mqtt)

ToZigbee2mqttInfo ...

func (Zigbee2mqtt) UpdateBridgeByIdRequest added in v0.5.2

func (u Zigbee2mqtt) UpdateBridgeByIdRequest(obj *api.UpdateBridgeRequest) (bridge *m.Zigbee2mqtt)

UpdateBridgeByIdRequest ...

func (Zigbee2mqtt) UpdateBridgeByIdResult added in v0.5.2

func (u Zigbee2mqtt) UpdateBridgeByIdResult(bridge *m.Zigbee2mqtt) (obj *api.Zigbee2Mqtt)

UpdateBridgeByIdResult ...

Jump to

Keyboard shortcuts

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