From 66727df2c1aa369b9250e7596fea6c8ae8385eaa Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sat, 9 May 2020 17:40:41 -0700 Subject: add document ttl --- db/schemas.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'db/schemas.go') diff --git a/db/schemas.go b/db/schemas.go index bad1e53..bdfa60c 100644 --- a/db/schemas.go +++ b/db/schemas.go @@ -1,12 +1,15 @@ package db -import "github.com/globalsign/mgo/bson" +import ( + "time" + + "github.com/globalsign/mgo/bson" +) // Paste represents a single paste type Paste struct { ID bson.ObjectId `bson:"_id,omitempty"` Hash string Content string + Expiry time.Time `bson:"expiry"` } - -// add timestamp and expiry later -- cgit v1.2.3