MCPcopy
hub / github.com/gofiber/fiber / Links

Method Links

res.go:602–620  ·  view source on GitHub ↗

Links joins the links followed by the property to populate the response's Link HTTP header field.

(link ...string)

Source from the content-addressed store, hash-verified

600
601// Links joins the links followed by the property to populate the response's Link HTTP header field.
602func (r *DefaultRes) Links(link ...string) {
603 if len(link) == 0 {
604 return
605 }
606 bb := bytebufferpool.Get()
607 for i := range link {
608 if i%2 == 0 {
609 bb.WriteByte('<')
610 bb.WriteString(link[i])
611 bb.WriteByte('>')
612 } else {
613 bb.WriteString(`; rel="`)
614 bb.WriteString(link[i])
615 bb.WriteString(`",`)
616 }
617 }
618 r.setCanonical(HeaderLink, utils.TrimRight(r.c.app.toString(bb.Bytes()), ','))
619 bytebufferpool.Put(bb)
620}
621
622// Location sets the response Location HTTP header to the specified path parameter.
623func (r *DefaultRes) Location(path string) {

Callers

nothing calls this directly

Calls 7

setCanonicalMethod · 0.95
toStringMethod · 0.80
GetMethod · 0.65
WriteByteMethod · 0.65
WriteStringMethod · 0.65
BytesMethod · 0.65
PutMethod · 0.65

Tested by

no test coverage detected