mirror of
https://github.com/Luzifer/ots.git
synced 2025-05-17 05:22:26 -04:00
Replace redis client, move expiry into creation interface
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
900d816dff
commit
ea631beeef
8 changed files with 51 additions and 80 deletions
3
api.go
3
api.go
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
@ -53,7 +54,7 @@ func (a apiServer) handleCreate(res http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
id, err := a.store.Create(secret)
|
||||
id, err := a.store.Create(secret, time.Duration(cfg.SecretExpiry)*time.Second)
|
||||
if err != nil {
|
||||
a.errorResponse(res, http.StatusInternalServerError, err.Error())
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue