mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-02 20:28:38 -04:00
Move users and securities to store
This commit is contained in:
@ -5,17 +5,37 @@ import (
|
||||
)
|
||||
|
||||
type SessionStore interface {
|
||||
SessionExists(secret string) (bool, error)
|
||||
InsertSession(session *models.Session) error
|
||||
GetSession(secret string) (*models.Session, error)
|
||||
SessionExists(secret string) (bool, error)
|
||||
DeleteSession(session *models.Session) error
|
||||
}
|
||||
|
||||
type UserStore interface {
|
||||
UsernameExists(username string) (bool, error)
|
||||
InsertUser(user *models.User) error
|
||||
GetUser(userid int64) (*models.User, error)
|
||||
GetUserByUsername(username string) (*models.User, error)
|
||||
UpdateUser(user *models.User) error
|
||||
DeleteUser(user *models.User) error
|
||||
}
|
||||
|
||||
type SecurityStore interface {
|
||||
InsertSecurity(security *models.Security) error
|
||||
GetSecurity(securityid int64, userid int64) (*models.Security, error)
|
||||
GetSecurities(userid int64) (*[]*models.Security, error)
|
||||
FindMatchingSecurities(userid int64, security *models.Security) (*[]*models.Security, error)
|
||||
UpdateSecurity(security *models.Security) error
|
||||
DeleteSecurity(security *models.Security) error
|
||||
}
|
||||
|
||||
type Tx interface {
|
||||
Commit() error
|
||||
Rollback() error
|
||||
|
||||
SessionStore
|
||||
UserStore
|
||||
SecurityStore
|
||||
}
|
||||
|
||||
type Store interface {
|
||||
|
Reference in New Issue
Block a user