MCPcopy
hub / github.com/perkeep/perkeep / SetShareExpiration

Method SetShareExpiration

pkg/schema/blob.go:394–404  ·  view source on GitHub ↗

SetShareExpiration sets the expiration time on share claim. It panics if bb isn't a "share" claim type. If t is zero, the expiration is removed.

(t time.Time)

Source from the content-addressed store, hash-verified

392// It panics if bb isn't a "share" claim type.
393// If t is zero, the expiration is removed.
394func (bb *Builder) SetShareExpiration(t time.Time) *Builder {
395 if bb.Type() != TypeClaim || bb.ClaimType() != ShareClaim {
396 panic("called SetShareExpiration on non-share")
397 }
398 if t.IsZero() {
399 delete(bb.m, "expires")
400 } else {
401 bb.m["expires"] = RFC3339FromTime(t)
402 }
403 return bb
404}
405
406func (bb *Builder) SetShareIsTransitive(b bool) *Builder {
407 if bb.Type() != TypeClaim || bb.ClaimType() != ShareClaim {

Callers 4

TestHandleGetViaSharingFunction · 0.80
RunCommandMethod · 0.80

Calls 4

TypeMethod · 0.95
ClaimTypeMethod · 0.95
deleteFunction · 0.85
RFC3339FromTimeFunction · 0.85

Tested by 3

TestHandleGetViaSharingFunction · 0.64