mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-15 03:23:01 +00:00
24 lines
432 B
Go
24 lines
432 B
Go
|
package model
|
||
|
|
||
|
import "errors"
|
||
|
|
||
|
var (
|
||
|
ErrSessionNotFound = errors.New("session not found")
|
||
|
)
|
||
|
|
||
|
type Session struct {
|
||
|
ID string
|
||
|
InstanceURL string
|
||
|
AccessToken string
|
||
|
}
|
||
|
|
||
|
type SessionRepository interface {
|
||
|
Add(session Session) (err error)
|
||
|
Update(sessionID string, accessToken string) (err error)
|
||
|
Get(sessionID string) (session Session, err error)
|
||
|
}
|
||
|
|
||
|
func (s Session) IsLoggedIn() bool {
|
||
|
return len(s.AccessToken) > 0
|
||
|
}
|