Documentation ¶
Index ¶
- Variables
- func CancelSubscription(s storage.Store, r *http.Request) (int, string)
- func ChangeMasterPassword(s storage.Store, user *model.User, newMasterPassword string) (*model.User, error)
- func CreateBankAccount(s storage.Store, dto *model.BankAccountDTO, schema string) (*model.BankAccount, error)
- func CreateCreditCard(s storage.Store, dto *model.CreditCardDTO, schema string) (*model.CreditCard, error)
- func CreateEmail(s storage.Store, dto *model.EmailDTO, schema string) (*model.Email, error)
- func CreateHash(key string) string
- func CreateLogin(s storage.Store, dto *model.LoginDTO, schema string) (*model.Login, error)
- func CreateLogins(s storage.Store, dtos []model.LoginDTO, schema string) error
- func CreateNote(s storage.Store, dto *model.NoteDTO, schema string) (*model.Note, error)
- func CreateServer(s storage.Store, dto *model.ServerDTO, schema string) (*model.Server, error)
- func CreateSubscription(s storage.Store, r *http.Request) (int, string)
- func CreateToken(user *model.User) (*model.TokenDetailsDTO, error)
- func CreateUser(s storage.Store, userDTO *model.UserDTO) (*model.User, error)
- func Decrypt(dataStr string, passphrase string) ([]byte, error)
- func DecryptFile(filename string, passphrase string) ([]byte, error)
- func DecryptJSON(key string, encrypted []byte, v interface{}) error
- func DecryptModel(rawModel interface{}) (interface{}, error)
- func DecryptPayload(key string, encrypted []byte) ([]byte, error)
- func Encrypt(dataStr string, passphrase string) ([]byte, error)
- func EncryptFile(filename string, data []byte, passphrase string)
- func EncryptJSON(key string, v interface{}) ([]byte, error)
- func EncryptModel(rawModel interface{}) interface{}
- func FallbackInsecureKey(length int) (string, error)
- func FindAllBankAccounts(s storage.Store, schema string) ([]model.BankAccount, error)
- func FindAllCreditCards(s storage.Store, schema string) ([]model.CreditCard, error)
- func FindAllEmails(s storage.Store, schema string) ([]model.Email, error)
- func FindAllLogins(s storage.Store, schema string) ([]model.Login, error)
- func FindAllNotes(s storage.Store, schema string) ([]model.Note, error)
- func FindAllServers(s storage.Store, schema string) ([]model.Server, error)
- func FindIndex(vs []string, t string) int
- func GenerateSchema(s storage.Store, user *model.User) (*model.User, error)
- func GenerateSecureKey(length int) (string, error)
- func GetBackupFiles() ([]os.FileInfo, error)
- func GetMD5Hash(text []byte) string
- func MigrateSystemTables(s storage.Store)
- func MigrateUserTables(s storage.Store, schema string) error
- func NewBcrypt(key []byte) string
- func PayloadValidator(model interface{}) error
- func PaymentFailedSubscription(s storage.Store, r *http.Request) (int, string)
- func PaymentSucceedSubscription(s storage.Store, r *http.Request) (int, string)
- func RandomMD5Hash() string
- func SendMail(name, email string, subject, bodyHTML string) error
- func TokenValid(bearerToken string) (*jwt.Token, error)
- func UpdateBankAccount(s storage.Store, bankAccount *model.BankAccount, dto *model.BankAccountDTO, ...) (*model.BankAccount, error)
- func UpdateCreditCard(s storage.Store, creditCard *model.CreditCard, dto *model.CreditCardDTO, ...) (*model.CreditCard, error)
- func UpdateEmail(s storage.Store, email *model.Email, dto *model.EmailDTO, schema string) (*model.Email, error)
- func UpdateLogin(s storage.Store, login *model.Login, dto *model.LoginDTO, schema string) (*model.Login, error)
- func UpdateNote(s storage.Store, note *model.Note, dto *model.NoteDTO, schema string) (*model.Note, error)
- func UpdateServer(s storage.Store, server *model.Server, dto *model.ServerDTO, schema string) (*model.Server, error)
- func UpdateSubscription(s storage.Store, r *http.Request) (int, string)
- func UpdateUser(s storage.Store, user *model.User, userDTO *model.UserDTO, isAuthorized bool) (*model.User, error)
Constants ¶
This section is empty.
Variables ¶
var ( //ErrExpiredToken represents message for expired token ErrExpiredToken = errors.New("token expired or invalid") ErrUnauthorized = errors.New("unauthorized") )
var ( // ErrGenerateSchema represents message for generating schema ErrGenerateSchema = errors.New("an error occured while genarating schema") // ErrCreateSchema represents message for creating schema ErrCreateSchema = errors.New("an error occured while creating the schema and tables") )
Functions ¶
func CancelSubscription ¶ added in v1.1.3
func ChangeMasterPassword ¶ added in v1.2.1
func ChangeMasterPassword(s storage.Store, user *model.User, newMasterPassword string) (*model.User, error)
ChangeMasterPassword updates the user with the new master password
func CreateBankAccount ¶
func CreateBankAccount(s storage.Store, dto *model.BankAccountDTO, schema string) (*model.BankAccount, error)
CreateBankAccount creates a new bank account and saves it to the store
func CreateCreditCard ¶
func CreateCreditCard(s storage.Store, dto *model.CreditCardDTO, schema string) (*model.CreditCard, error)
CreateCreditCard creates a new credit card and saves it to the store
func CreateEmail ¶
CreateEmail creates a new bank account and saves it to the store
func CreateLogin ¶
CreateLogin creates a login and saves it to the store
func CreateLogins ¶
CreateLogins is needed for import
func CreateNote ¶
CreateNote creates a new note and saves it to the store
func CreateServer ¶
CreateServer creates a server and saves it to the store
func CreateSubscription ¶ added in v1.1.3
CreateSubscription creates a subscription and saves it to the store
func CreateToken ¶
func CreateToken(user *model.User) (*model.TokenDetailsDTO, error)
CreateToken ...
func CreateUser ¶
CreateUser creates a user and saves it to the store
func DecryptFile ¶
DecryptFile ...
func DecryptJSON ¶
DecryptJSON ...
func DecryptModel ¶
func DecryptModel(rawModel interface{}) (interface{}, error)
DecryptModel decrypts struct pointer according to struct tags
func DecryptPayload ¶ added in v1.1.7
DecryptPayload ...
func EncryptFile ¶
EncryptFile ...
func EncryptModel ¶
func EncryptModel(rawModel interface{}) interface{}
EncryptModel encrypts struct pointer according to struct tags
func FallbackInsecureKey ¶
FallbackInsecureKey fallback method for sercure key
func FindAllBankAccounts ¶ added in v1.2.1
FindAllBankAccounts finds all logins
func FindAllCreditCards ¶ added in v1.2.1
FindAllCreditCards finds all logins
func FindAllEmails ¶ added in v1.2.1
FindAllEmails finds all logins
func FindAllLogins ¶ added in v1.2.1
FindAllLogins finds all logins
func FindAllNotes ¶ added in v1.2.1
FindAllNotes finds all logins
func FindAllServers ¶ added in v1.2.1
FindAllServers finds all logins
func GenerateSchema ¶
GenerateSchema creates user schema and tables
func GenerateSecureKey ¶
GenerateSecureKey generates a secure key width a given length
func GetBackupFiles ¶
GetBackupFiles retrieves backup files
func MigrateSystemTables ¶
MigrateSystemTables runs auto migration for the system models (Token and User), will only add missing fields won't delete/change current data in the store.
func MigrateUserTables ¶
MigrateUserTables runs auto migration for user models in user schema, will only add missing fields won't delete/change current data in the store.
func PayloadValidator ¶ added in v1.1.7
func PayloadValidator(model interface{}) error
PayloadValidator ...
func PaymentFailedSubscription ¶ added in v1.1.3
func PaymentSucceedSubscription ¶ added in v1.1.3
func RandomMD5Hash ¶
func RandomMD5Hash() string
RandomMD5Hash returns random md5 hash for unique conifrim links
func UpdateBankAccount ¶
func UpdateBankAccount(s storage.Store, bankAccount *model.BankAccount, dto *model.BankAccountDTO, schema string) (*model.BankAccount, error)
UpdateBankAccount updates the account with the dto and applies the changes in the store
func UpdateCreditCard ¶
func UpdateCreditCard(s storage.Store, creditCard *model.CreditCard, dto *model.CreditCardDTO, schema string) (*model.CreditCard, error)
UpdateCreditCard updates the credit card with the dto and applies the changes in the store
func UpdateEmail ¶
func UpdateEmail(s storage.Store, email *model.Email, dto *model.EmailDTO, schema string) (*model.Email, error)
UpdateEmail updates the account with the dto and applies the changes in the store
func UpdateLogin ¶
func UpdateLogin(s storage.Store, login *model.Login, dto *model.LoginDTO, schema string) (*model.Login, error)
UpdateLogin updates the login with the dto and applies the changes in the store
func UpdateNote ¶
func UpdateNote(s storage.Store, note *model.Note, dto *model.NoteDTO, schema string) (*model.Note, error)
UpdateNote updates the note with the dto and applies the changes in the store
func UpdateServer ¶
func UpdateServer(s storage.Store, server *model.Server, dto *model.ServerDTO, schema string) (*model.Server, error)
UpdateServer updates the server with the dto and applies the changes in the store
func UpdateSubscription ¶ added in v1.1.3
Types ¶
This section is empty.