Fix status content style
[bloat] / model / session.go
1 package model
2
3 import (
4         "errors"
5 )
6
7 var (
8         ErrSessionNotFound = errors.New("session not found")
9 )
10
11 type Session struct {
12         ID             string   `json:"id"`
13         InstanceDomain string   `json:"instance_domain"`
14         AccessToken    string   `json:"access_token"`
15         Settings       Settings `json:"settings"`
16 }
17
18 type SessionRepository interface {
19         Add(session Session) (err error)
20         Get(sessionID string) (session Session, err error)
21 }
22
23 func (s Session) IsLoggedIn() bool {
24         return len(s.AccessToken) > 0
25 }