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

Method DefaultTransport

codegen/example/server_data.go:151–161  ·  view source on GitHub ↗

DefaultTransport returns the default transport for the given server. If multiple transports are defined, HTTP transport is used as the default.

()

Source from the content-addressed store, hash-verified

149// DefaultTransport returns the default transport for the given server.
150// If multiple transports are defined, HTTP transport is used as the default.
151func (s *Data) DefaultTransport() *TransportData {
152 if len(s.Transports) == 1 {
153 return s.Transports[0]
154 }
155 for _, t := range s.Transports {
156 if t.Type == TransportHTTP {
157 return t
158 }
159 }
160 return nil // bug
161}
162
163// HasTransport checks if the server supports the given transport.
164func (s *Data) HasTransport(transport Transport) bool {

Callers 2

exampleCLIFunction · 0.80
exampleCLIMainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected