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

Function Header

dsl/http.go:399–410  ·  view source on GitHub ↗

Header describes a single HTTP header or gRPC metadata header. The properties (description, type, validation etc.) of a header are inherited from the request or response type attribute with the same name by default. Header must appear in the API HTTP or JSONRPC expression (to define request headers

(name string, args ...any)

Source from the content-addressed store, hash-verified

397// })
398// })
399func Header(name string, args ...any) {
400 h := headers(eval.Current())
401 if h == nil {
402 eval.IncompatibleDSL()
403 return
404 }
405 if name == "" {
406 eval.ReportError("header name cannot be empty")
407 }
408 eval.Execute(func() { Attribute(name, args...) }, h.AttributeExpr)
409 h.Remap()
410}
411
412// Cookie identifies a HTTP cookie. When used within a Response the Cookie DSL
413// also makes it possible to define the cookie attributes.

Calls 7

CurrentFunction · 0.92
IncompatibleDSLFunction · 0.92
ReportErrorFunction · 0.92
ExecuteFunction · 0.92
headersFunction · 0.85
AttributeFunction · 0.85
RemapMethod · 0.80