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

Method Schemes

expr/api.go:131–146  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

129// The possible values for the elements of the returned slice are "http",
130// "https", "grpc" and "grpcs".
131func (a *APIExpr) Schemes() []string {
132 schemes := make(map[string]struct{})
133 for _, s := range a.Servers {
134 for _, sch := range s.Schemes() {
135 schemes[sch] = struct{}{}
136 }
137 }
138 ss := make([]string, len(schemes))
139 i := 0
140 for s := range schemes {
141 ss[i] = s
142 i++
143 }
144 sort.Strings(ss)
145 return ss
146}
147
148// DefaultServer returns a server expression that describes a server which
149// exposes all the services in the design and listens on localhost port 80 for

Callers 5

TestAPIExprSchemesFunction · 0.45
buildPathFromFileServerFunction · 0.45
buildPathFromExprFunction · 0.45
buildServerDataFunction · 0.45
buildHostDataFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestAPIExprSchemesFunction · 0.36