(out interface{ Write(p []byte) (int, error) }, file providers.File)
| 68 | } |
| 69 | |
| 70 | func printEndpointTable(out interface{ Write(p []byte) (int, error) }, file providers.File) { |
| 71 | fmt.Fprintf(out, "Endpoints: %d\n", len(file.Endpoints)) |
| 72 | for _, name := range file.SortedNames() { |
| 73 | ep := file.Endpoints[name] |
| 74 | fmt.Fprintf(out, "- %s\n", name) |
| 75 | fmt.Fprintf(out, " URL: %s\n", ep.Endpoint) |
| 76 | if ep.SupportedClient != "" { |
| 77 | clients := ep.Clients() |
| 78 | sort.Strings(clients) |
| 79 | fmt.Fprintf(out, " Clients: %s\n", joinComma(clients)) |
| 80 | } |
| 81 | if ep.APIKeyEnv != "" { |
| 82 | status := "missing" |
| 83 | if os.Getenv(ep.APIKeyEnv) != "" { |
| 84 | status = "set" |
| 85 | } |
| 86 | fmt.Fprintf(out, " API key: %s (%s)\n", ep.APIKeyEnv, status) |
| 87 | } |
| 88 | if len(ep.Models) > 0 { |
| 89 | fmt.Fprintf(out, " Models: %s\n", joinComma(ep.Models)) |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | func joinComma(items []string) string { |
| 95 | out := "" |
no test coverage detected