Skip to content

Commit

Permalink
Create UUID for a key based on IP
Browse files Browse the repository at this point in the history
  • Loading branch information
airenas committed May 31, 2023
1 parent 086c381 commit 0752681
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pkg/mongodb/ipSaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/airenas/go-app/pkg/goapp"
"github.com/google/uuid"
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
Expand Down Expand Up @@ -44,6 +45,7 @@ func (ss *IPSaver) CheckCreate(ip string, limit float64) error {

res := &keyRecord{}
res.Key = ip
res.KeyID = uuid.NewString()
res.Manual = false
res.Limit = limit
res.ValidTo = time.Date(2100, time.Month(1), 1, 01, 0, 0, 0, time.UTC)
Expand Down

0 comments on commit 0752681

Please sign in to comment.