Documentation ¶
Index ¶
- type Application
- func (a *Application) APIAddSecretHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) APIDashboardActiveSecretsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) APIDashboardExpiredSecretsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) APIDeleteSecretByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) APIExpireSecretExpiresAtFieldByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) APIRenewSecretExpiresAtFieldByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) APIRestoreSecretAccessCodeFieldByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) APIUnlockSecretHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) APIUserLoginHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) APIUserLogoutHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) MiddlewareHTMXRequest(next httprouter.Handle) httprouter.Handle
- func (a *Application) MiddlewareUserAuth(next httprouter.Handle) httprouter.Handle
- func (a *Application) MiddlewareUserAuthWithHTMXRequest(next httprouter.Handle) httprouter.Handle
- func (a *Application) PageDashboardAddSecretHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) PageDashboardIndexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) PageDashboardShareSecretHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) PageIndexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (a *Application) PageSecretHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) QRCodeGenerationHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
- func (a *Application) Run() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Attachments *attachments.Attachments Config *config.Config Database *database.Database Session *session.Session }
Application contains DB connection and other dependencies for application.
func New ¶
func New(a *attachments.Attachments, c *config.Config, d *database.Database, s *session.Session) *Application
New returns a new instance of Application.
func (*Application) APIAddSecretHandler ¶
func (a *Application) APIAddSecretHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
APIAddSecretHandler adds a new secret to the database (POST).
func (*Application) APIDashboardActiveSecretsHandler ¶
func (a *Application) APIDashboardActiveSecretsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
APIDashboardActiveSecretsHandler renders the active secrets block (GET).
func (*Application) APIDashboardExpiredSecretsHandler ¶
func (a *Application) APIDashboardExpiredSecretsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
APIDashboardExpiredSecretsHandler renders the expired secrets block.
func (*Application) APIDeleteSecretByKeyHandler ¶
func (a *Application) APIDeleteSecretByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
APIDeleteSecretByKeyHandler deletes a secret by its key from the database (DELETE).
func (*Application) APIExpireSecretExpiresAtFieldByKeyHandler ¶
func (a *Application) APIExpireSecretExpiresAtFieldByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
APIExpireSecretExpiresAtFieldByKeyHandler expires a secret 'expires_at' field by its key from the database (PATCH).
func (*Application) APIRenewSecretExpiresAtFieldByKeyHandler ¶
func (a *Application) APIRenewSecretExpiresAtFieldByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
APIRenewSecretExpiresAtFieldByKeyHandler renews a secret 'expires_at' field by its key from the database (PATCH).
func (*Application) APIRestoreSecretAccessCodeFieldByKeyHandler ¶
func (a *Application) APIRestoreSecretAccessCodeFieldByKeyHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
APIRestoreSecretAccessCodeFieldByKeyHandler restores a secret 'access_code' field by its key from the database (PATCH).
func (*Application) APIUnlockSecretHandler ¶
func (a *Application) APIUnlockSecretHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
APIUnlockSecretHandler renders the unlocked secret block (POST).
func (*Application) APIUserLoginHandler ¶
func (a *Application) APIUserLoginHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
APIUserLoginHandler logs in the user (POST).
func (*Application) APIUserLogoutHandler ¶
func (a *Application) APIUserLogoutHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
APIUserLogoutHandler logs out the user (GET).
func (*Application) MiddlewareHTMXRequest ¶
func (a *Application) MiddlewareHTMXRequest(next httprouter.Handle) httprouter.Handle
MiddlewareHTMXRequest checks, if request is a valid HTMX request.
func (*Application) MiddlewareUserAuth ¶
func (a *Application) MiddlewareUserAuth(next httprouter.Handle) httprouter.Handle
MiddlewareUserAuth checks, if the user is authenticated in the session cookie.
func (*Application) MiddlewareUserAuthWithHTMXRequest ¶
func (a *Application) MiddlewareUserAuthWithHTMXRequest(next httprouter.Handle) httprouter.Handle
MiddlewareUserAuth checks, if the user is authenticated in the session cookie.
func (*Application) PageDashboardAddSecretHandler ¶
func (a *Application) PageDashboardAddSecretHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
PageDashboardAddSecretHandler renders the add secret page (GET).
func (*Application) PageDashboardIndexHandler ¶
func (a *Application) PageDashboardIndexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
PageDashboardIndexHandler renders the dashboard index page (GET).
func (*Application) PageDashboardShareSecretHandler ¶
func (a *Application) PageDashboardShareSecretHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
PageDashboardShareSecretHandler renders the share secret page (GET).
func (*Application) PageIndexHandler ¶
func (a *Application) PageIndexHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
PageIndexHandler renders the index page (GET).
func (*Application) PageSecretHandler ¶
func (a *Application) PageSecretHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
PageSecretHandler renders the secret page (GET).
func (*Application) QRCodeGenerationHandler ¶
func (a *Application) QRCodeGenerationHandler(w http.ResponseWriter, r *http.Request, params httprouter.Params)
QRCodeGenerationHandler generates a QR code image from a given text (GET).