Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
df6cfa0b
Commit
df6cfa0b
authored
Oct 13, 2016
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: add GC method to interface to standardize handling
parent
cf8801dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
storage.go
storage/storage.go
+8
-2
No files found.
storage/storage.go
View file @
df6cfa0b
...
...
@@ -38,6 +38,12 @@ func NewID() string {
return
strings
.
TrimRight
(
encoding
.
EncodeToString
(
buff
),
"="
)
}
// GCResult returns the number of objects deleted by garbage collection.
type
GCResult
struct
{
AuthRequests
int64
AuthCodes
int64
}
// Storage is the storage interface used by the server. Implementations, at minimum
// require compare-and-swap atomic actions.
//
...
...
@@ -80,8 +86,8 @@ type Storage interface {
UpdateAuthRequest
(
id
string
,
updater
func
(
a
AuthRequest
)
(
AuthRequest
,
error
))
error
UpdatePassword
(
email
string
,
updater
func
(
p
Password
)
(
Password
,
error
))
error
//
TODO(ericchiang): Add a GarbageCollect(now time.Time) method so conformance tests
// can test implementations.
//
GarbageCollect deletes all expired AuthCodes and AuthRequests.
GarbageCollect
(
now
time
.
Time
)
(
GCResult
,
error
)
}
// Client represents an OAuth2 client.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment