aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/session/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/session/service.go')
-rw-r--r--pkg/session/service.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/session/service.go b/pkg/session/service.go
new file mode 100644
index 0000000..83009bc
--- /dev/null
+++ b/pkg/session/service.go
@@ -0,0 +1,20 @@
+package session
+
+import "time"
+
+type Service interface {
+ GetByToken(token string) *UserSession
+ GetBySID(sid uint) *UserSession
+ Create(uid int32, username string, ip string, ua string) (*UserSession, error)
+ Destroy(sid uint) error
+}
+
+type UserSession struct {
+ UserID int32
+ SessionID uint
+ Token string
+ Username string
+ IP string
+ LoginTime time.Time
+ UserAgent string
+}