aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/session/service.go
blob: 83009bce924b88b373e1d2adbe88a79bea3bb6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
}