Documentation ¶
Index ¶
- Constants
- Variables
- func BulkUpdateCreditCards(s db.Store) http.HandlerFunc
- func BulkUpdateEmails(s db.Store) http.HandlerFunc
- func BulkUpdateLogins(s db.Store) http.HandlerFunc
- func BulkUpdateNotes(s db.Store) http.HandlerFunc
- func BulkUpdateServers(s db.Store) http.HandlerFunc
- func ChangePasswordRequest(masterPassword, email string) string
- func CheckCredentials(s db.Store) http.HandlerFunc
- func CheckToken(s db.Store) http.HandlerFunc
- func CreateCode(s db.Store) http.HandlerFunc
- func CreateCreditCard(s db.Store) http.HandlerFunc
- func CreateDeleteCode(s db.Store) http.HandlerFunc
- func CreateEmail(s db.Store) http.HandlerFunc
- func CreateLogin(s db.Store) http.HandlerFunc
- func CreateNote(s db.Store) http.HandlerFunc
- func CreateServer(s db.Store) http.HandlerFunc
- func CreateSubscription(s db.Store) http.HandlerFunc
- func CreateUser(s db.Store) http.HandlerFunc
- func DeleteCreditCard(s db.Store) http.HandlerFunc
- func DeleteEmail(s db.Store) http.HandlerFunc
- func DeleteLogin(s db.Store) http.HandlerFunc
- func DeleteNote(s db.Store) http.HandlerFunc
- func DeleteServer(s db.Store) http.HandlerFunc
- func DeleteSubscription(s db.Store) http.HandlerFunc
- func DeleteUser(s db.Store) http.HandlerFunc
- func EmailVerification(email, code string) string
- func Export(s db.Store) http.HandlerFunc
- func FindAllCreditCards(s db.Store) http.HandlerFunc
- func FindAllEmails(s db.Store) http.HandlerFunc
- func FindAllLogins(s db.Store) http.HandlerFunc
- func FindAllNotes(s db.Store) http.HandlerFunc
- func FindAllServers(s db.Store) http.HandlerFunc
- func FindAllSubscriptions(s db.Store) http.HandlerFunc
- func FindAllUsers(s db.Store) http.HandlerFunc
- func FindCreditCardByID(s db.Store) http.HandlerFunc
- func FindEmailByID(s db.Store) http.HandlerFunc
- func FindLoginsByID(s db.Store) http.HandlerFunc
- func FindNoteByID(s db.Store) http.HandlerFunc
- func FindServerByID(s db.Store) http.HandlerFunc
- func FindSubscriptionByID(s db.Store) http.HandlerFunc
- func FindUserByID(s db.Store) http.HandlerFunc
- func ForgotMasterPassword(s db.Store) http.HandlerFunc
- func GeneratePassword(w http.ResponseWriter, r *http.Request)
- func GetErrors(errs []validator.FieldError) []string
- func HealthCheck(s db.Store) http.HandlerFunc
- func Import(s db.Store) http.HandlerFunc
- func Language(s db.Store) http.HandlerFunc
- func Languages(s db.Store) http.HandlerFunc
- func PostSubscription(s db.Store) http.HandlerFunc
- func RecoverDelete(s db.Store) http.HandlerFunc
- func RefreshToken(s db.Store) http.HandlerFunc
- func ResetMasterPasswordInstructions(email, code string) string
- 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 RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
- func Restore(s db.Store) http.HandlerFunc
- func SendFMP(s db.Store) http.HandlerFunc
- func SetArgs(r *http.Request, fields []string) (map[string]string, map[string]int)
- func Signin(s db.Store) http.HandlerFunc
- func Signout() http.HandlerFunc
- func Signup(s db.Store) http.HandlerFunc
- func TestLogin(s db.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 UpdateCreditCard(s db.Store) http.HandlerFunc
- func UpdateEmail(s db.Store) http.HandlerFunc
- func UpdateLogin(s db.Store) http.HandlerFunc
- func UpdateNote(s db.Store) http.HandlerFunc
- func UpdateServer(s db.Store) http.HandlerFunc
- func UpdateUser(s db.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 BulkUpdateCreditCards ¶
func BulkUpdateCreditCards(s db.Store) http.HandlerFunc
BulkUpdateCreditCards updates creditCards in payload
func BulkUpdateEmails ¶
func BulkUpdateEmails(s db.Store) http.HandlerFunc
BulkUpdateEmails updates emails in payload
func BulkUpdateLogins ¶
func BulkUpdateLogins(s db.Store) http.HandlerFunc
BulkUpdateLogins updates logins in payload
func BulkUpdateNotes ¶
func BulkUpdateNotes(s db.Store) http.HandlerFunc
BulkUpdateNotes updates notes in payload
func BulkUpdateServers ¶
func BulkUpdateServers(s db.Store) http.HandlerFunc
BulkUpdateServers updates servers in payload
func ChangePasswordRequest ¶
func CreateCreditCard ¶
func CreateCreditCard(s db.Store) http.HandlerFunc
CreateCreditCard creates a credit cart
func CreateDeleteCode ¶
func CreateDeleteCode(s db.Store) http.HandlerFunc
Create user deletion code
func CreateSubscription ¶
func CreateSubscription(s db.Store) http.HandlerFunc
CreateSubscription ...
func DeleteCreditCard ¶
func DeleteCreditCard(s db.Store) http.HandlerFunc
DeleteCreditCard deletes a credit cart
func DeleteSubscription ¶
func DeleteSubscription(s db.Store) http.HandlerFunc
DeleteSubscription ...
func EmailVerification ¶
func Export ¶
func Export(s db.Store) http.HandlerFunc
Export exports all logins as CSV file Export exports all data as CSV file
func FindAllCreditCards ¶
func FindAllCreditCards(s db.Store) http.HandlerFunc
FindAllCreditCards finds all credid carts
func FindAllSubscriptions ¶
func FindAllSubscriptions(s db.Store) http.HandlerFunc
FindAllSubscriptions ...
func FindCreditCardByID ¶
func FindCreditCardByID(s db.Store) http.HandlerFunc
FindCreditCardByID finds a credit cart by id
func FindLoginsByID ¶
func FindLoginsByID(s db.Store) http.HandlerFunc
FindLoginsByID finds a login by id
func FindSubscriptionByID ¶
func FindSubscriptionByID(s db.Store) http.HandlerFunc
FindSubscriptionByID ...
func ForgotMasterPassword ¶
func ForgotMasterPassword(s db.Store) http.HandlerFunc
func GeneratePassword ¶
func GeneratePassword(w http.ResponseWriter, r *http.Request)
GeneratePassword generates new password
func RecoverDelete ¶
func RecoverDelete(s db.Store) http.HandlerFunc
func RespondWithCookie ¶
func RespondWithCookie(w http.ResponseWriter, code int, cookie *http.Cookie, payload interface{})
RespondWithCookie
func RespondWithEncJSON ¶
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 RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON write json
func Restore ¶
func Restore(s db.Store) http.HandlerFunc
Restore restores logins from backup file ./store/$PASSWORD_MANAGER_NAME-{BACKUP_DATE}.bak
func Signout ¶
func Signout() http.HandlerFunc
func TestLogin ¶
func TestLogin(s db.Store) http.HandlerFunc
TestLogin login endpoint for test purposes
func UpdateCreditCard ¶
func UpdateCreditCard(s db.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 ...