Documentation ¶
Index ¶
- func NewModels(db *sql.DB) interface{}
- type AccountModel
- type AuthSessionModel
- type CategoryModel
- type Models
- type TransactionModel
- type UserModel
- func (m *UserModel) Authenticate(email, password string) (string, error)
- func (m *UserModel) Confirm(id int64) error
- func (m *UserModel) Delete(id int64) error
- func (m *UserModel) Get(id int64) (*models.User, error)
- func (m *UserModel) GetByEmail(email string) (*models.User, error)
- func (m *UserModel) Insert(email, password string) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountModel ¶
type AuthSessionModel ¶
AuthSessionModel represents the MySQL data storage for authentication sessions
func (*AuthSessionModel) Delete ¶
func (m *AuthSessionModel) Delete(id int64) error
Delete removed authentication session by its ID
func (*AuthSessionModel) Get ¶
func (m *AuthSessionModel) Get(id int64) (*models.AuthSession, error)
Get retrieves auth_session record by its ID
func (*AuthSessionModel) GetByToken ¶
func (m *AuthSessionModel) GetByToken(token string) (*models.AuthSession, error)
GetByToken retrieves auth_session record by its token
type CategoryModel ¶
func (*CategoryModel) Insert ¶
func (m *CategoryModel) Insert(name string, categoryType models.CategoryType, userID int64, inactive bool) (int64, error)
type TransactionModel ¶
type UserModel ¶
UserModel represents the MySQL data storage for users
func (*UserModel) Authenticate ¶
Authenticate check the user crendentials and generate auth token
func (*UserModel) Confirm ¶
Confirm confirms a not-confirmed user. Returns error if the user does not exists
func (*UserModel) GetByEmail ¶
GetByEmail fetches a user by email. Returns a Zero value if the user not found
Click to show internal directories.
Click to hide internal directories.