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

Struct HTTPEndpointExpr

expr/http_endpoint.go:23–87  ·  view source on GitHub ↗

HTTPEndpointExpr describes a HTTP endpoint. It embeds a MethodExpr and adds HTTP specific properties. It defines both an HTTP endpoint and the shape of HTTP requests and responses made to that endpoint. The shape of requests is defined via "parameters", there are path parameters (i.e. portions of t

Source from the content-addressed store, hash-verified

21 // define parameter values), query string parameters and a payload parameter
22 // (request body).
23 HTTPEndpointExpr struct {
24 eval.DSLFunc
25 // MethodExpr is the underlying method expression.
26 MethodExpr *MethodExpr
27 // Service is the parent service.
28 Service *HTTPServiceExpr
29 // Endpoint routes
30 Routes []*RouteExpr
31 // MapQueryParams - when not nil - indicates that the HTTP
32 // request query string parameters are used to build a map.
33 // - If the value is the empty string then the map is stored
34 // in the method payload (which must be of type Map)
35 // - If the value is a non-empty string then the map is
36 // stored in the payload attribute with the corresponding
37 // name (which must of be of type Map)
38 MapQueryParams *string
39 // Params defines the HTTP request path and query parameters.
40 Params *MappedAttributeExpr
41 // Headers defines the HTTP request headers.
42 Headers *MappedAttributeExpr
43 // Cookies defines the HTTP request cookies.
44 Cookies *MappedAttributeExpr
45 // Body describes the HTTP request body.
46 Body *AttributeExpr
47 // StreamingBody describes the body transferred through the websocket
48 // stream.
49 StreamingBody *AttributeExpr
50 // PayloadIDAttribute is the name of the JSON-RPC request ID
51 // payload attribute.
52 PayloadIDAttribute string
53 // ResultIDAttribute is the name of the JSON-RPC result ID
54 // result attribute.
55 ResultIDAttribute string
56 // SkipRequestBodyEncodeDecode indicates that the service method accepts
57 // a reader and that the client provides a reader to stream the request
58 // body.
59 SkipRequestBodyEncodeDecode bool
60 // SkipResponseBodyEncodeDecode indicates that the service method
61 // returns a reader and that the client accepts a reader to stream the
62 // response body.
63 SkipResponseBodyEncodeDecode bool
64 // Responses is the list of all the possible success HTTP
65 // responses.
66 Responses []*HTTPResponseExpr
67 // HTTPErrors is the list of all the possible error HTTP
68 // responses.
69 HTTPErrors []*HTTPErrorExpr
70 // Requirements contains the security requirements for the HTTP endpoint.
71 Requirements []*SecurityExpr
72 // MultipartRequest indicates that the request content type for
73 // the endpoint is a multipart type.
74 MultipartRequest bool
75 // Redirect defines a redirect for the endpoint.
76 Redirect *HTTPRedirectExpr
77 // SSE defines the Server-Sent Events configuration for this endpoint if it's
78 // a streaming endpoint. If nil, the endpoint uses WebSockets by default or
79 // inherits the service-level SSE configuration if defined.
80 SSE *HTTPSSEExpr

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected