| 123 | } |
| 124 | |
| 125 | func (i *imlExportConfigController) appendFiles(ctx *gin.Context) ([]*ExportFile, error) { |
| 126 | type exportConfig struct { |
| 127 | exportFunc func(ctx *gin.Context) (interface{}, error) |
| 128 | driver string |
| 129 | } |
| 130 | |
| 131 | exports := []exportConfig{ |
| 132 | { |
| 133 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 134 | return i.teamModule.ExportAll(ctx) |
| 135 | }, |
| 136 | driver: "team", |
| 137 | }, |
| 138 | { |
| 139 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 140 | return i.serviceModule.ExportAll(ctx) |
| 141 | }, |
| 142 | driver: "service", |
| 143 | }, |
| 144 | { |
| 145 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 146 | return i.appModule.ExportAll(ctx) |
| 147 | }, |
| 148 | driver: "app", |
| 149 | }, |
| 150 | { |
| 151 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 152 | return i.routerModule.ExportAll(ctx) |
| 153 | }, |
| 154 | driver: "api", |
| 155 | }, |
| 156 | { |
| 157 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 158 | return i.upstreamModule.ExportAll(ctx) |
| 159 | }, |
| 160 | driver: "upstream", |
| 161 | }, |
| 162 | { |
| 163 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 164 | return i.applicationAuthorizationModule.ExportAll(ctx) |
| 165 | }, |
| 166 | driver: "authorization", |
| 167 | }, |
| 168 | { |
| 169 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 170 | return i.catalogueModule.ExportAll(ctx) |
| 171 | }, |
| 172 | driver: "catalogue", |
| 173 | }, |
| 174 | { |
| 175 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 176 | return i.subscribeModule.ExportAll(ctx) |
| 177 | }, |
| 178 | driver: "subscribe", |
| 179 | }, |
| 180 | { |
| 181 | exportFunc: func(ctx *gin.Context) (interface{}, error) { |
| 182 | return i.applyModule.ExportAll(ctx) |