MCPcopy
hub / github.com/perkeep/perkeep / MustGetBlobRef

Function MustGetBlobRef

internal/httputil/httputil.go:234–240  ·  view source on GitHub ↗

MustGetBlobRef returns a non-nil BlobRef from req, as given by param. If it doesn't, it panics with a value understood by Recover or RecoverJSON.

(req *http.Request, param string)

Source from the content-addressed store, hash-verified

232// MustGetBlobRef returns a non-nil BlobRef from req, as given by param.
233// If it doesn't, it panics with a value understood by Recover or RecoverJSON.
234func MustGetBlobRef(req *http.Request, param string) blob.Ref {
235 br, ok := blob.Parse(MustGet(req, param))
236 if !ok {
237 panic(InvalidParameterError(param))
238 }
239 return br
240}
241
242// OptionalInt returns the integer in req given by param, or 0 if not present.
243// If the form value is not an integer, it panics with a a value understood by Recover or RecoverJSON.

Callers 5

fromHTTPMethod · 0.92
fromHTTPMethod · 0.92
fromHTTPMethod · 0.92
serveSignerAttrValueMethod · 0.92
fromHTTPGetMethod · 0.92

Calls 3

ParseFunction · 0.92
MustGetFunction · 0.85
InvalidParameterErrorTypeAlias · 0.85

Tested by

no test coverage detected