github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/api/controllers/controllers.go (about) 1 // This file is part of the Smart Home 2 // Program complex distribution https://github.com/e154/smart-home 3 // Copyright (C) 2016-2023, Filippov Alex 4 // 5 // This library is free software: you can redistribute it and/or 6 // modify it under the terms of the GNU Lesser General Public 7 // License as published by the Free Software Foundation; either 8 // version 3 of the License, or (at your option) any later version. 9 // 10 // This library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 // Library General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public 16 // License along with this library. If not, see 17 // <https://www.gnu.org/licenses/>. 18 19 package controllers 20 21 import ( 22 "github.com/e154/smart-home/endpoint" 23 m "github.com/e154/smart-home/models" 24 "github.com/e154/smart-home/system/access_list" 25 "github.com/e154/smart-home/system/stream/handlers" 26 "github.com/e154/smart-home/system/validation" 27 ) 28 29 // Controllers ... 30 type Controllers struct { 31 *ControllerAuth 32 *ControllerStream 33 *ControllerUser 34 *ControllerRole 35 *ControllerScript 36 *ControllerTag 37 *ControllerImage 38 *ControllerPlugin 39 *ControllerZigbee2mqtt 40 *ControllerEntity 41 *ControllerAction 42 *ControllerCondition 43 *ControllerTrigger 44 *ControllerAutomation 45 *ControllerArea 46 *ControllerDeveloperTools 47 *ControllerInteract 48 *ControllerLogs 49 *ControllerDashboard 50 *ControllerDashboardCardItem 51 *ControllerDashboardCard 52 *ControllerDashboardTab 53 *ControllerVariable 54 *ControllerEntityStorage 55 *ControllerMetric 56 *ControllerBackup 57 *ControllerMessageDelivery 58 *ControllerIndex 59 *ControllerMqtt 60 *ControllerMedia 61 *ControllerWebdav 62 } 63 64 // NewControllers ... 65 func NewControllers( 66 accessList access_list.AccessListService, 67 endpoint *endpoint.Endpoint, 68 _ *handlers.EventHandler, 69 appConfig *m.AppConfig, 70 validation *validation.Validate) *Controllers { 71 common := NewControllerCommon(endpoint, accessList, appConfig, validation) 72 return &Controllers{ 73 ControllerAuth: NewControllerAuth(common), 74 ControllerStream: NewControllerStream(common), 75 ControllerUser: NewControllerUser(common), 76 ControllerRole: NewControllerRole(common), 77 ControllerScript: NewControllerScript(common), 78 ControllerTag: NewControllerTag(common), 79 ControllerImage: NewControllerImage(common), 80 ControllerPlugin: NewControllerPlugin(common), 81 ControllerZigbee2mqtt: NewControllerZigbee2mqtt(common), 82 ControllerEntity: NewControllerEntity(common), 83 ControllerAction: NewControllerAction(common), 84 ControllerCondition: NewControllerCondition(common), 85 ControllerTrigger: NewControllerTrigger(common), 86 ControllerAutomation: NewControllerAutomation(common), 87 ControllerArea: NewControllerArea(common), 88 ControllerDeveloperTools: NewControllerDeveloperTools(common), 89 ControllerInteract: NewControllerInteract(common), 90 ControllerLogs: NewControllerLogs(common), 91 ControllerDashboard: NewControllerDashboard(common), 92 ControllerDashboardCardItem: NewControllerDashboardCardItem(common), 93 ControllerDashboardCard: NewControllerDashboardCard(common), 94 ControllerDashboardTab: NewControllerDashboardTab(common), 95 ControllerVariable: NewControllerVariable(common), 96 ControllerEntityStorage: NewControllerEntityStorage(common), 97 ControllerMetric: NewControllerMetric(common), 98 ControllerBackup: NewControllerBackup(common), 99 ControllerMessageDelivery: NewControllerMessageDelivery(common), 100 ControllerIndex: NewControllerIndex(common), 101 ControllerMqtt: NewControllerMqtt(common), 102 ControllerMedia: NewControllerMedia(common), 103 ControllerWebdav: NewControllerWebdav(common), 104 } 105 }