Skip to content

Commit 68ae704

Browse files
committed
session: add comments to the session.State types
1 parent 1a389d1 commit 68ae704

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

session/interface.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,30 @@ const (
2626
// State represents the state of a session.
2727
type State uint8
2828

29+
/*
30+
/---> StateExpired
31+
StateCreated ---
32+
\---> StateRevoked
33+
*/
34+
2935
const (
36+
// StateCreated is the state of a session once it has been fully
37+
// committed to the Store and is ready to be used. This is the first
38+
// state of a session.
3039
StateCreated State = 0
31-
StateInUse State = 1
40+
41+
// StateInUse is the state of a session that is currently being used.
42+
//
43+
// NOTE: this state is not currently used, but we keep it around for now
44+
// since old sessions might still have this state persisted.
45+
StateInUse State = 1
46+
47+
// StateRevoked is the state of a session that has been revoked before
48+
// its expiry date.
3249
StateRevoked State = 2
50+
51+
// StateExpired is the state of a session that has passed its expiry
52+
// date.
3353
StateExpired State = 3
3454
)
3555

0 commit comments

Comments
 (0)