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

Function Cookie

dsl/http.go:457–468  ·  view source on GitHub ↗

Cookie identifies a HTTP cookie. When used within a Response the Cookie DSL also makes it possible to define the cookie attributes. Cookie must appear in the API HTTP or JSONRPC expression (to define request cookies common to all the API endpoints), a service HTTP or JSONRPC expression (to define r

(name string, args ...any)

Source from the content-addressed store, hash-verified

455// })
456// })
457func Cookie(name string, args ...any) {
458 h := cookies(eval.Current())
459 if h == nil {
460 eval.IncompatibleDSL()
461 return
462 }
463 if name == "" {
464 eval.ReportError("header name cannot be empty")
465 }
466 eval.Execute(func() { Attribute(name, args...) }, h.AttributeExpr)
467 h.Remap()
468}
469
470// CookieMaxAge defines the "max-age" attribute of a HTTP response cookie.
471//

Callers 8

cookie_dsls.goFile · 0.85
endpoint_dsls.goFile · 0.85
payload_dsls.goFile · 0.85
TestTooManyArgErrorFunction · 0.85

Calls 7

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

Tested by 1

TestTooManyArgErrorFunction · 0.68