Initial commit

This commit is contained in:
r 2019-12-13 18:08:26 +00:00
commit 5e4da01c3a
43 changed files with 3429 additions and 0 deletions

23
model/session.go Normal file
View file

@ -0,0 +1,23 @@
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
}