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

Function Server

dsl/server.go:59–74  ·  view source on GitHub ↗

Server describes a single process listening for client requests. The DSL defines the set of services that the server exposes as well as host details. Not defining a server in a design has the same effect as defining a single server that exposes all of the services defined in the design in a single h

(name string, fn ...func())

Source from the content-addressed store, hash-verified

57// })
58// })
59func Server(name string, fn ...func()) *expr.ServerExpr {
60 server := &expr.ServerExpr{Name: name}
61 if len(fn) > 1 {
62 eval.TooManyArgError()
63 return server
64 }
65 api, ok := eval.Current().(*expr.APIExpr)
66 if !ok {
67 eval.IncompatibleDSL()
68 }
69 if len(fn) > 0 {
70 eval.Execute(fn[0], server)
71 }
72 api.Servers = append(api.Servers, server)
73 return server
74}
75
76// Services sets the list of services implemented by a server.
77//

Callers 6

dsls.goFile · 0.50
TestTooManyArgErrorFunction · 0.50
dsl_spec_test.goFile · 0.50
dsls.goFile · 0.50
service_dsls.goFile · 0.50

Calls 4

TooManyArgErrorFunction · 0.92
CurrentFunction · 0.92
IncompatibleDSLFunction · 0.92
ExecuteFunction · 0.92