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

Method Schemes

expr/server.go:115–130  ·  view source on GitHub ↗

Schemes returns the list of transport schemes used by all the server endpoints. The possible values for the elements of the returned slice are "http", "https", "grpc" and "grpcs".

()

Source from the content-addressed store, hash-verified

113// endpoints. The possible values for the elements of the returned slice are
114// "http", "https", "grpc" and "grpcs".
115func (s *ServerExpr) Schemes() []string {
116 schemes := make(map[string]struct{})
117 for _, h := range s.Hosts {
118 for _, sch := range h.Schemes() {
119 schemes[sch] = struct{}{}
120 }
121 }
122 ss := make([]string, len(schemes))
123 i := 0
124 for s := range schemes {
125 ss[i] = s
126 i++
127 }
128 sort.Strings(ss)
129 return ss
130}
131
132var validSchemes = map[string]struct{}{"http": {}, "https": {}, "grpc": {}, "grpcs": {}}
133

Callers

nothing calls this directly

Calls 1

SchemesMethod · 0.45

Tested by

no test coverage detected