Documentation ¶
Index ¶
- Constants
- Variables
- func BulkUpdateBankAccounts(s storage.Store) http.HandlerFunc
- func BulkUpdateCreditCards(s storage.Store) http.HandlerFunc
- func BulkUpdateEmails(s storage.Store) http.HandlerFunc
- func BulkUpdateLogins(s storage.Store) http.HandlerFunc
- func BulkUpdateNotes(s storage.Store) http.HandlerFunc
- func BulkUpdateServers(s storage.Store) http.HandlerFunc
- func ChangeMasterPassword(s storage.Store) http.HandlerFunc
- func CheckCredentials(s storage.Store) http.HandlerFunc
- func CheckToken(s storage.Store) http.HandlerFunc
- func CheckUpdate(w http.ResponseWriter, r *http.Request)
- func CreateBankAccount(s storage.Store) http.HandlerFunc
- func CreateCode(s storage.Store) http.HandlerFunc
- func CreateCreditCard(s storage.Store) http.HandlerFunc
- func CreateDeleteCode(s storage.Store) http.HandlerFunc
- func CreateEmail(s storage.Store) http.HandlerFunc
- func CreateLogin(s storage.Store) http.HandlerFunc
- func CreateNote(s storage.Store) http.HandlerFunc
- func CreateServer(s storage.Store) http.HandlerFunc
- func CreateSubscription(s storage.Store) http.HandlerFunc
- func CreateUser(s storage.Store) http.HandlerFunc
- func DeleteBankAccount(s storage.Store) http.HandlerFunc
- func DeleteCreditCard(s storage.Store) http.HandlerFunc
- func DeleteEmail(s storage.Store) http.HandlerFunc
- func DeleteLogin(s storage.Store) http.HandlerFunc
- func DeleteNote(s storage.Store) http.HandlerFunc
- func DeleteServer(s storage.Store) http.HandlerFunc
- func DeleteSubscription(s storage.Store) http.HandlerFunc
- func DeleteUser(s storage.Store) http.HandlerFunc
- func Export(s storage.Store) http.HandlerFunc
- func FindAllBankAccounts(s storage.Store) http.HandlerFunc
- func FindAllCreditCards(s storage.Store) http.HandlerFunc
- func FindAllEmails(s storage.Store) http.HandlerFunc
- func FindAllLogins(s storage.Store) http.HandlerFunc
- func FindAllNotes(s storage.Store) http.HandlerFunc
- func FindAllServers(s storage.Store) http.HandlerFunc
- func FindAllSubscriptions(s storage.Store) http.HandlerFunc
- func FindAllUsers(s storage.Store) http.HandlerFunc
- func FindBankAccountByID(s storage.Store) http.HandlerFunc
- func FindCreditCardByID(s storage.Store) http.HandlerFunc
- func FindEmailByID(s storage.Store) http.HandlerFunc
- func FindLoginsByID(s storage.Store) http.HandlerFunc
- func FindNoteByID(s storage.Store) http.HandlerFunc
- func FindServerByID(s storage.Store) http.HandlerFunc
- func FindSubscriptionByID(s storage.Store) http.HandlerFunc
- func FindUserByID(s storage.Store) http.HandlerFunc
- func GeneratePassword(w http.ResponseWriter, r *http.Request)
- func GetErrors(errs []validator.FieldError) []string
- func HealthCheck(s storage.Store) http.HandlerFunc
- func Import(s storage.Store) http.HandlerFunc
- func Language(s storage.Store) http.HandlerFunc
- func Languages(s storage.Store) http.HandlerFunc
- func PostSubscription(s storage.Store) http.HandlerFunc
- func RecoverDelete(s storage.Store) http.HandlerFunc
- func RefreshToken(s storage.Store) http.HandlerFunc
- func RespondWithCookie(w http.ResponseWriter, code int, cookie *http.Cookie, payload interface{})
- func RespondWithEncJSON(w http.ResponseWriter, code int, transmissionKey string, payload interface{})
- func RespondWithError(w http.ResponseWriter, code int, message string)
- func RespondWithErrors(w http.ResponseWriter, code int, message string, errors []string)
- func RespondWithHTML(w http.ResponseWriter, code int, payload interface{})
- func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- func Restore(s storage.Store) http.HandlerFunc
- func SetArgs(r *http.Request, fields []string) (map[string]string, map[string]int)
- func Signin(s storage.Store) http.HandlerFunc
- func Signout() http.HandlerFunc
- func Signup(s storage.Store) http.HandlerFunc
- func TestLogin(s storage.Store) http.HandlerFunc
- func ToBody(r *http.Request, env, transmissionKey string) error
- func ToPayload(r *http.Request) (model.Payload, error)
- func ToSnakeCase(str string) string
- func UpdateBankAccount(s storage.Store) http.HandlerFunc
- func UpdateCreditCard(s storage.Store) http.HandlerFunc
- func UpdateEmail(s storage.Store) http.HandlerFunc
- func UpdateLogin(s storage.Store) http.HandlerFunc
- func UpdateNote(s storage.Store) http.HandlerFunc
- func UpdateServer(s storage.Store) http.HandlerFunc
- func UpdateUser(s storage.Store) http.HandlerFunc
- func VerifyCode() http.HandlerFunc
- type ErrorResponseDTO
- type HealthProp
- type Services
Constants ¶
const ( // InvalidRequestPayload represents invalid request payload messaage InvalidRequestPayload = "Invalid request payload" // CreditCardDeleted represents message when deleting credit cart successfully CreditCardDeleted = "CreditCard deleted successfully!" // Success represent success message Success = "Success" )
const ( //InvalidJSON represents a message for invalid json InvalidJSON = "Invalid json provided" //RestoreBackupSuccess represents a message when restoring from backap successfully RestoreBackupSuccess = "Restore from backup completed successfully!" //ImportSuccess represents when inporting successgully ImportSuccess = "Import finished successfully!" //BackupSuccess represents when backup completed successfully BackupSuccess = "Backup completed successfully!" )
const (
//ServerDeleteSuccess represents message when deleting server successfully
ServerDeleteSuccess = "Server deleted successfully!"
)
const (
//SubscriptionDeleteSuccess represents message when deletind subscription successfully
SubscriptionDeleteSuccess = "Subscription deleted successfully!"
)
Variables ¶
var ( //Port representd a server port Port = "3625" //ServerAddress represents a server addres ServerAddress = "0.0.0.0" + ":" + Port )
Functions ¶
func BulkUpdateBankAccounts ¶ added in v1.2.1
func BulkUpdateBankAccounts(s storage.Store) http.HandlerFunc
BulkUpdateBankAccounts updates bankAccounts in payload
func BulkUpdateCreditCards ¶ added in v1.2.1
func BulkUpdateCreditCards(s storage.Store) http.HandlerFunc
BulkUpdateCreditCards updates creditCards in payload
func BulkUpdateEmails ¶ added in v1.2.1
func BulkUpdateEmails(s storage.Store) http.HandlerFunc
BulkUpdateEmails updates emails in payload
func BulkUpdateLogins ¶ added in v1.2.1
func BulkUpdateLogins(s storage.Store) http.HandlerFunc
BulkUpdateLogins updates logins in payload
func BulkUpdateNotes ¶ added in v1.2.1
func BulkUpdateNotes(s storage.Store) http.HandlerFunc
BulkUpdateNotes updates notes in payload
func BulkUpdateServers ¶ added in v1.2.1
func BulkUpdateServers(s storage.Store) http.HandlerFunc
BulkUpdateServers updates servers in payload
func ChangeMasterPassword ¶ added in v1.2.1
func ChangeMasterPassword(s storage.Store) http.HandlerFunc
UpdateUser ...
func CheckCredentials ¶ added in v1.2.1
func CheckCredentials(s storage.Store) http.HandlerFunc
CheckCredentials ...
func CheckUpdate ¶
func CheckUpdate(w http.ResponseWriter, r *http.Request)
CheckUpdate generates new password
func CreateBankAccount ¶
func CreateBankAccount(s storage.Store) http.HandlerFunc
CreateBankAccount creates a bank aaccount
func CreateCode ¶ added in v1.1.7
func CreateCode(s storage.Store) http.HandlerFunc
Create email verification code
func CreateCreditCard ¶
func CreateCreditCard(s storage.Store) http.HandlerFunc
CreateCreditCard creates a credit cart
func CreateDeleteCode ¶ added in v1.2.1
func CreateDeleteCode(s storage.Store) http.HandlerFunc
Create user deletion code
func CreateSubscription ¶ added in v1.1.3
func CreateSubscription(s storage.Store) http.HandlerFunc
CreateSubscription ...
func DeleteBankAccount ¶
func DeleteBankAccount(s storage.Store) http.HandlerFunc
DeleteBankAccount deletes a bank account
func DeleteCreditCard ¶
func DeleteCreditCard(s storage.Store) http.HandlerFunc
DeleteCreditCard deletes a credit cart
func DeleteSubscription ¶ added in v1.1.3
func DeleteSubscription(s storage.Store) http.HandlerFunc
DeleteSubscription ...
func Export ¶ added in v1.2.1
func Export(s storage.Store) http.HandlerFunc
Export exports all data as CSV file
func FindAllBankAccounts ¶
func FindAllBankAccounts(s storage.Store) http.HandlerFunc
FindAllBankAccounts finds all bank accounts
func FindAllCreditCards ¶
func FindAllCreditCards(s storage.Store) http.HandlerFunc
FindAllCreditCards finds all credid carts
func FindAllLogins ¶
func FindAllLogins(s storage.Store) http.HandlerFunc
FindAllLogins finds all logins
func FindAllNotes ¶
func FindAllNotes(s storage.Store) http.HandlerFunc
FindAllNotes finds all notes
func FindAllSubscriptions ¶ added in v1.1.3
func FindAllSubscriptions(s storage.Store) http.HandlerFunc
FindAllSubscriptions ...
func FindBankAccountByID ¶
func FindBankAccountByID(s storage.Store) http.HandlerFunc
FindBankAccountByID finds a bank account by id
func FindCreditCardByID ¶
func FindCreditCardByID(s storage.Store) http.HandlerFunc
FindCreditCardByID finds a credit cart by id
func FindLoginsByID ¶
func FindLoginsByID(s storage.Store) http.HandlerFunc
FindLoginsByID finds a login by id
func FindNoteByID ¶
func FindNoteByID(s storage.Store) http.HandlerFunc
FindNoteByID finds a note by id
func FindSubscriptionByID ¶ added in v1.1.3
func FindSubscriptionByID(s storage.Store) http.HandlerFunc
FindSubscriptionByID ...
func GeneratePassword ¶
func GeneratePassword(w http.ResponseWriter, r *http.Request)
GeneratePassword generates new password
func PostSubscription ¶ added in v1.1.3
func PostSubscription(s storage.Store) http.HandlerFunc
PostSubscription ...
func RecoverDelete ¶ added in v1.2.1
func RecoverDelete(s storage.Store) http.HandlerFunc
func RespondWithCookie ¶ added in v1.2.1
func RespondWithCookie(w http.ResponseWriter, code int, cookie *http.Cookie, payload interface{})
RespondWithToken
func RespondWithEncJSON ¶ added in v1.1.7
func RespondWithEncJSON(w http.ResponseWriter, code int, transmissionKey string, payload interface{})
RespondWithEncJSON encrypts returning json data
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, code int, message string)
RespondWithError ...
func RespondWithErrors ¶
func RespondWithErrors(w http.ResponseWriter, code int, message string, errors []string)
RespondWithErrors ...
func RespondWithHTML ¶ added in v1.1.3
func RespondWithHTML(w http.ResponseWriter, code int, payload interface{})
RespondWithHTML write html
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON write json
func Restore ¶
func Restore(s storage.Store) http.HandlerFunc
Restore restores logins from backup file ./store/passwall-{BACKUP_DATE}.bak
func Signout ¶ added in v1.2.1
func Signout() http.HandlerFunc
func TestLogin ¶
func TestLogin(s storage.Store) http.HandlerFunc
TestLogin login endpoint for test purposes
func UpdateBankAccount ¶
func UpdateBankAccount(s storage.Store) http.HandlerFunc
UpdateBankAccount updates a bank account
func UpdateCreditCard ¶
func UpdateCreditCard(s storage.Store) http.HandlerFunc
UpdateCreditCard updates a credit cart
Types ¶
type ErrorResponseDTO ¶
type ErrorResponseDTO struct { Code int `json:"code"` Status string `json:"status"` Message string `json:"message"` Errors []string `json:"errors"` }
ErrorResponseDTO represents error resposne
type HealthProp ¶
HealthProp ...
type Services ¶
type Services struct { API *HealthProp `json:"api"` Database *HealthProp `json:"database"` }
Services ...