(endpoint params.ForgeEndpoint)
| 289 | } |
| 290 | |
| 291 | func formatOneEndpoint(endpoint params.ForgeEndpoint) { |
| 292 | if outputFormat == common.OutputFormatJSON { |
| 293 | printAsJSON(endpoint) |
| 294 | return |
| 295 | } |
| 296 | t := table.NewWriter() |
| 297 | header := table.Row{"Field", "Value"} |
| 298 | t.AppendHeader(header) |
| 299 | t.AppendRow([]interface{}{"Name", endpoint.Name}) |
| 300 | t.AppendRow([]interface{}{"Description", endpoint.Description}) |
| 301 | t.AppendRow([]interface{}{"Created At", endpoint.CreatedAt}) |
| 302 | t.AppendRow([]interface{}{"Updated At", endpoint.UpdatedAt}) |
| 303 | t.AppendRow([]interface{}{"Base URL", endpoint.BaseURL}) |
| 304 | if endpoint.UploadBaseURL != "" { |
| 305 | t.AppendRow([]interface{}{"Upload URL", endpoint.UploadBaseURL}) |
| 306 | } |
| 307 | |
| 308 | if endpoint.EndpointType == params.GiteaEndpointType { |
| 309 | metadataURL := appdefaults.GiteaRunnerReleasesURL |
| 310 | if endpoint.ToolsMetadataURL != "" { |
| 311 | metadataURL = endpoint.ToolsMetadataURL |
| 312 | } |
| 313 | var useInternal bool |
| 314 | if endpoint.UseInternalToolsMetadata != nil { |
| 315 | useInternal = *endpoint.UseInternalToolsMetadata |
| 316 | } |
| 317 | t.AppendRow([]interface{}{"Tools metadata URL", metadataURL}) |
| 318 | t.AppendRow([]interface{}{"Use internal tools metadata URL", useInternal}) |
| 319 | } |
| 320 | t.AppendRow([]interface{}{"API Base URL", endpoint.APIBaseURL}) |
| 321 | if len(endpoint.CACertBundle) > 0 { |
| 322 | t.AppendRow([]interface{}{"CA Cert Bundle", string(endpoint.CACertBundle)}) |
| 323 | } |
| 324 | t.SetColumnConfigs([]table.ColumnConfig{ |
| 325 | {Number: 1, AutoMerge: true}, |
| 326 | {Number: 2, AutoMerge: false, WidthMax: 100}, |
| 327 | }) |
| 328 | fmt.Println(t.Render()) |
| 329 | } |
no test coverage detected