rename storage variables to store

This commit is contained in:
1e99 2024-11-08 17:08:02 +01:00
parent e51a5f4fd7
commit a7392da5fb

View file

@ -17,7 +17,7 @@ import (
var embedFS embed.FS var embedFS embed.FS
func run() error { func run() error {
storage, err := newStore() store, err := newStore()
if err != nil { if err != nil {
return err return err
} }
@ -36,13 +36,13 @@ func run() error {
mux.Handle( mux.Handle(
"POST /api/password", "POST /api/password",
middlewares.RateLimiter( middlewares.RateLimiter(
routes.CreatePassword(storage, maxPasswordLength), routes.CreatePassword(store, maxPasswordLength),
1*time.Minute, 1*time.Minute,
5, 5,
), ),
) )
mux.Handle("GET /api/password/{id}", routes.GetPassword(storage)) mux.Handle("GET /api/password/{id}", routes.GetPassword(store))
mux.Handle("HEAD /api/password/{id}", routes.HasPassword(storage)) mux.Handle("HEAD /api/password/{id}", routes.HasPassword(store))
if logRequests { if logRequests {
handler = middlewares.Logger(handler) handler = middlewares.Logger(handler)