Documentation ¶
Index ¶
- Variables
- type UserDataCli
- func (l *UserDataCli) AddNewUser(c *cli.Context, username string, email string, nickname string, ...) (*models.User, error)
- func (l *UserDataCli) CheckTransactionAndAccount(c *cli.Context, username string) (bool, error)
- func (l *UserDataCli) ClearUserTokens(c *cli.Context, username string) error
- func (l *UserDataCli) DeleteUser(c *cli.Context, username string) error
- func (l *UserDataCli) DisableUser(c *cli.Context, username string) error
- func (l *UserDataCli) DisableUserTwoFactorAuthorization(c *cli.Context, username string) error
- func (l *UserDataCli) EnableUser(c *cli.Context, username string) error
- func (l *UserDataCli) ExportTransaction(c *cli.Context, username string) ([]byte, error)
- func (l *UserDataCli) GetUserByUsername(c *cli.Context, username string) (*models.User, error)
- func (l *UserDataCli) ListUserTokens(c *cli.Context, username string) ([]*models.TokenRecord, error)
- func (l *UserDataCli) ModifyUserPassword(c *cli.Context, username string, password string) error
- func (l *UserDataCli) ResendVerifyEmail(c *cli.Context, username string) error
- func (l *UserDataCli) SendPasswordResetMail(c *cli.Context, username string) error
- func (l *UserDataCli) SetUserEmailUnverified(c *cli.Context, username string) error
- func (l *UserDataCli) SetUserEmailVerified(c *cli.Context, username string) error
Constants ¶
This section is empty.
Variables ¶
var ( UserData = &UserDataCli{ ezBookKeepingCsvExporter: &converters.EzBookKeepingCSVFileExporter{}, accounts: services.Accounts, transactions: services.Transactions, categories: services.TransactionCategories, tags: services.TransactionTags, users: services.Users, twoFactorAuthorizations: services.TwoFactorAuthorizations, tokens: services.Tokens, forgetPasswords: services.ForgetPasswords, } )
Initialize an user data cli singleton instance
Functions ¶
This section is empty.
Types ¶
type UserDataCli ¶
type UserDataCli struct {
// contains filtered or unexported fields
}
UserDataCli represents user data cli
func (*UserDataCli) AddNewUser ¶
func (l *UserDataCli) AddNewUser(c *cli.Context, username string, email string, nickname string, password string, defaultCurrency string) (*models.User, error)
AddNewUser adds a new user according to specified info
func (*UserDataCli) CheckTransactionAndAccount ¶
func (l *UserDataCli) CheckTransactionAndAccount(c *cli.Context, username string) (bool, error)
CheckTransactionAndAccount checks whether all user transactions and all user accounts are correct
func (*UserDataCli) ClearUserTokens ¶
func (l *UserDataCli) ClearUserTokens(c *cli.Context, username string) error
ClearUserTokens clears all tokens of the specified user
func (*UserDataCli) DeleteUser ¶
func (l *UserDataCli) DeleteUser(c *cli.Context, username string) error
DeleteUser deletes user according to the specified user name
func (*UserDataCli) DisableUser ¶ added in v0.4.0
func (l *UserDataCli) DisableUser(c *cli.Context, username string) error
DisableUser sets user disabled according to the specified user name
func (*UserDataCli) DisableUserTwoFactorAuthorization ¶
func (l *UserDataCli) DisableUserTwoFactorAuthorization(c *cli.Context, username string) error
DisableUserTwoFactorAuthorization disables 2fa for the specified user
func (*UserDataCli) EnableUser ¶ added in v0.4.0
func (l *UserDataCli) EnableUser(c *cli.Context, username string) error
EnableUser sets user enabled according to the specified user name
func (*UserDataCli) ExportTransaction ¶
func (l *UserDataCli) ExportTransaction(c *cli.Context, username string) ([]byte, error)
ExportTransaction returns csv file content according user all transactions
func (*UserDataCli) GetUserByUsername ¶
func (l *UserDataCli) GetUserByUsername(c *cli.Context, username string) (*models.User, error)
GetUserByUsername returns user by user name
func (*UserDataCli) ListUserTokens ¶
func (l *UserDataCli) ListUserTokens(c *cli.Context, username string) ([]*models.TokenRecord, error)
ListUserTokens returns all tokens of the specified user
func (*UserDataCli) ModifyUserPassword ¶
func (l *UserDataCli) ModifyUserPassword(c *cli.Context, username string, password string) error
ModifyUserPassword modifies user password
func (*UserDataCli) ResendVerifyEmail ¶ added in v0.4.0
func (l *UserDataCli) ResendVerifyEmail(c *cli.Context, username string) error
ResendVerifyEmail resends an email with account activation link
func (*UserDataCli) SendPasswordResetMail ¶ added in v0.4.0
func (l *UserDataCli) SendPasswordResetMail(c *cli.Context, username string) error
SendPasswordResetMail sends an email with password reset link
func (*UserDataCli) SetUserEmailUnverified ¶ added in v0.4.0
func (l *UserDataCli) SetUserEmailUnverified(c *cli.Context, username string) error
SetUserEmailUnverified sets user email address unverified
func (*UserDataCli) SetUserEmailVerified ¶ added in v0.4.0
func (l *UserDataCli) SetUserEmailVerified(c *cli.Context, username string) error
SetUserEmailVerified sets user email address verified