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

Function Project

expr/result_type.go:234–236  ·  view source on GitHub ↗

Project creates a ResultTypeExpr containing the fields defined in the view expression of m named after the view argument. The resulting result type defines a default view. The result type identifier is computed by adding a parameter called "view" to the original identifier. The value of the "view"

(rt *ResultTypeExpr, view string)

Source from the content-addressed store, hash-verified

232// individual attributes may use a different view. In this case Project uses
233// that view and returns an error if it isn't defined on the attribute type.
234func Project(rt *ResultTypeExpr, view string) (*ResultTypeExpr, error) {
235 return project(rt, view, make(map[string]*AttributeExpr))
236}
237
238func project(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr) (*ResultTypeExpr, error) {
239 _, params, _ := mime.ParseMediaType(rt.Identifier)

Callers 7

buildResponseBodyTypeMethod · 0.92
ResultTypeRefWithPrefixFunction · 0.92
buildResultTypeSchemaFunction · 0.92
buildBodyTypesFunction · 0.92
useExplicitViewMethod · 0.85
TestProjectFunction · 0.85

Calls 1

projectFunction · 0.85

Tested by 1

TestProjectFunction · 0.68