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)
| 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. |
| 234 | func Project(rt *ResultTypeExpr, view string) (*ResultTypeExpr, error) { |
| 235 | return project(rt, view, make(map[string]*AttributeExpr)) |
| 236 | } |
| 237 | |
| 238 | func project(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr) (*ResultTypeExpr, error) { |
| 239 | _, params, _ := mime.ParseMediaType(rt.Identifier) |