1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-02 20:28:38 -04:00

Lay groundwork and move sessions to 'store'

This commit is contained in:
2017-12-06 21:09:47 -05:00
parent 6bdde8e83b
commit c452984f23
18 changed files with 286 additions and 158 deletions

24
internal/store/store.go Normal file
View File

@ -0,0 +1,24 @@
package store
import (
"github.com/aclindsa/moneygo/internal/models"
)
type SessionStore interface {
InsertSession(session *models.Session) error
GetSession(secret string) (*models.Session, error)
SessionExists(secret string) (bool, error)
DeleteSession(session *models.Session) error
}
type Tx interface {
Commit() error
Rollback() error
SessionStore
}
type Store interface {
Begin() (Tx, error)
Close() error
}