MCPcopy Create free account
hub / github.com/goadesign/goa / Schemes

Method Schemes

expr/server.go:193–206  ·  view source on GitHub ↗

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".

()

Source from the content-addressed store, hash-verified

191// possible values for the elements of the returned slice are "http", "https",
192// "grpc" and "grpcs".
193func (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.

Callers 3

HasHTTPSchemeMethod · 0.95
HasGRPCSchemeMethod · 0.95
SchemesMethod · 0.45

Calls 1

SchemeMethod · 0.45

Tested by

no test coverage detected