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

Method Get

codegen/example/server_data.go:123–130  ·  view source on GitHub ↗

Get returns the server data for the given server expression. It builds the server data if the server name does not exist in the map.

(svr *expr.ServerExpr, root *expr.RootExpr)

Source from the content-addressed store, hash-verified

121// Get returns the server data for the given server expression. It builds the
122// server data if the server name does not exist in the map.
123func (d ServersData) Get(svr *expr.ServerExpr, root *expr.RootExpr) *Data {
124 if data, ok := d[svr.Name]; ok {
125 return data
126 }
127 sd := buildServerData(svr, root)
128 d[svr.Name] = sd
129 return sd
130}
131
132// DefaultHost returns the first host defined in the server expression.
133func (s *Data) DefaultHost() *HostData {

Callers 4

exampleSvrMainFunction · 0.45
exampleCLIMainFunction · 0.45
addServicesImportsFunction · 0.45

Calls 1

buildServerDataFunction · 0.85

Tested by

no test coverage detected