bloat/model/session.go
r 2678f33157 Add support for scopes
- Add scope selection for for new post
- Save new post scope in db
- Copy scope on reply
- Show scope icon on posts
2019-12-21 13:26:31 +00:00

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
}