Schemes returns the list of transport schemes defined for the host. The possible values for the elements of the returned slice are "http", "https", "grpc" and "grpcs".
()
| 191 | // possible values for the elements of the returned slice are "http", "https", |
| 192 | // "grpc" and "grpcs". |
| 193 | func (h *HostExpr) Schemes() []string { |
| 194 | schemes := make(map[string]struct{}) |
| 195 | for _, uri := range h.URIs { |
| 196 | schemes[uri.Scheme()] = struct{}{} |
| 197 | } |
| 198 | ss := make([]string, len(schemes)) |
| 199 | i := 0 |
| 200 | for s := range schemes { |
| 201 | ss[i] = s |
| 202 | i++ |
| 203 | } |
| 204 | sort.Strings(ss) |
| 205 | return ss |
| 206 | } |
| 207 | |
| 208 | // HasHTTPScheme returns true if at least one of the URIs in the host |
| 209 | // expression define "http" or "https" scheme. |
no test coverage detected