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())
| 284 | // }) |
| 285 | // }) |
| 286 | func 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 | // |
no test coverage detected