| 1 |
package router |
| 2 |
|
| 3 |
import "sort" |
| 4 |
|
| 5 |
// SupportedSchemas returns the sorted list of service schemas supported by this build. |
| 6 |
// |
| 7 |
// Returns: |
| 8 |
// - []string: the supported service schemas. |
| 9 |
func SupportedSchemas() []string { |
| 10 |
schemas := make([]string, 0, len(serviceMap)) |
| 11 |
for scheme := range serviceMap { |
| 12 |
schemas = append(schemas, scheme) |
| 13 |
} |
| 14 |
|
| 15 |
sort.Strings(schemas) |
| 16 |
|
| 17 |
return schemas |
| 18 |
} |
| 19 |
|
| 20 |
// SupportsSchema reports whether schema is supported by this build. |
| 21 |
// |
| 22 |
// Parameters: |
| 23 |
// - schema: the service schema to check. |
| 24 |
// |
| 25 |
// Returns: |
| 26 |
// - bool: true if the schema is supported. |
| 27 |
func SupportsSchema(schema string) bool { |
| 28 |
_, ok := serviceMap[schema] |
| 29 |
|
| 30 |
return ok |
| 31 |
} |