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

Function Host

dsl/server.go:117–130  ·  view source on GitHub ↗

Host defines a server host. A single server may define multiple hosts. Each host lists the set of URIs that identify it. The Host expression is leveraged by the example generator to produce the service and client commands. It is also consumed by the OpenAPI specification generator to initialize the

(name string, fn func())

Source from the content-addressed store, hash-verified

115// })
116// })
117func Host(name string, fn func()) {
118 s, ok := eval.Current().(*expr.ServerExpr)
119 if !ok {
120 eval.IncompatibleDSL()
121 return
122 }
123 host := &expr.HostExpr{
124 Name: name,
125 ServerName: s.Name,
126 Variables: &expr.AttributeExpr{Type: &expr.Object{}},
127 }
128 eval.Execute(fn, host)
129 s.Hosts = append(s.Hosts, host)
130}
131
132// URI defines a server host URI. A single host may define multiple URIs. The
133// supported schemes are 'http', 'https', 'grpc' and 'grpcs' where 'grpcs'

Callers 4

openapi_dsls.goFile · 0.85
TestTooManyArgErrorFunction · 0.85
dsls.goFile · 0.85

Calls 3

CurrentFunction · 0.92
IncompatibleDSLFunction · 0.92
ExecuteFunction · 0.92