mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-12-25 15:09:49 +00:00
2678f33157
- Add scope selection for for new post - Save new post scope in db - Copy scope on reply - Show scope icon on posts
26 lines
496 B
Go
26 lines
496 B
Go
package model
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
var (
|
|
ErrSessionNotFound = errors.New("session not found")
|
|
)
|
|
|
|
type Session struct {
|
|
ID string `json:"id"`
|
|
InstanceDomain string `json:"instance_domain"`
|
|
AccessToken string `json:"access_token"`
|
|
Settings Settings `json:"settings"`
|
|
}
|
|
|
|
type SessionRepository interface {
|
|
Add(session Session) (err error)
|
|
Get(sessionID string) (session Session, err error)
|
|
}
|
|
|
|
func (s Session) IsLoggedIn() bool {
|
|
return len(s.AccessToken) > 0
|
|
}
|