Initial
This commit is contained in:
commit
97dc0a3570
78 files changed
+7054
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package invite
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Invite struct {
|
||||
Token string
|
||||
Quota int
|
||||
Uses int
|
||||
ExpiresAt time.Time
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
func (i *Invite) IsValid() bool {
|
||||
return time.Now().UTC().Before(i.ExpiresAt) || i.Uses < i.Quota
|
||||
}
|
||||
Reference in new issue
Block a user