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

Function Metadata

dsl/grpc.go:286–296  ·  view source on GitHub ↗

Metadata defines a gRPC request metadata. Metadata must appear in a gRPC endpoint expression to describe gRPC request metadata. Security attributes in the method payload are automatically added to the request metadata unless specified explicitly in request message using Message function. All other

(fn func())

Source from the content-addressed store, hash-verified

284// })
285// })
286func Metadata(fn func()) {
287 switch e := eval.Current().(type) {
288 case *expr.GRPCEndpointExpr:
289 attr := &expr.AttributeExpr{}
290 if eval.Execute(fn, attr) {
291 e.Metadata = expr.NewMappedAttributeExpr(attr)
292 }
293 default:
294 eval.IncompatibleDSL()
295 }
296}
297
298// Trailers defines gRPC trailers in response metadata.
299//

Callers 2

endpoint_dsls.goFile · 0.85
dsls.goFile · 0.85

Calls 4

CurrentFunction · 0.92
ExecuteFunction · 0.92
NewMappedAttributeExprFunction · 0.92
IncompatibleDSLFunction · 0.92

Tested by

no test coverage detected