From 9dc15ca469aed5f3063f1fce2c416c1a44f3d962 Mon Sep 17 00:00:00 2001 From: Roman Vanesyan Date: Sat, 31 Aug 2024 17:18:46 +0300 Subject: [PATCH] fix: fix import --- internal/uuidv7/uuidv7.go | 17 +++++++++++++++++ password/handler.go | 2 +- passwordreset/handler.go | 2 +- strategy/session/session.go | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 internal/uuidv7/uuidv7.go diff --git a/internal/uuidv7/uuidv7.go b/internal/uuidv7/uuidv7.go new file mode 100644 index 0000000..aba1710 --- /dev/null +++ b/internal/uuidv7/uuidv7.go @@ -0,0 +1,17 @@ +// uuidv7 is a wrapper around google's uuid package. +package uuidv7 + +import ( + "github.com/google/uuid" + "go.inout.gg/foundations/must" +) + +// Must returns a new random UUID. It panics if there is an error. +func Must() uuid.UUID { + return must.Must(uuid.NewV7()) +} + +// FromString parses a UUID from a string. +func FromString(s string) (uuid.UUID, error) { + return uuid.Parse(s) +} diff --git a/password/handler.go b/password/handler.go index 14a2ab0..24adebe 100644 --- a/password/handler.go +++ b/password/handler.go @@ -13,7 +13,7 @@ import ( "go.inout.gg/shield/password/verification" "go.inout.gg/shield/user" "go.inout.gg/foundations/debug" - "go.inout.gg/foundations/internal/uuidv7" + "go.inout.gg/shield/internal/uuidv7" "go.inout.gg/foundations/sql/db/dbutil" ) diff --git a/passwordreset/handler.go b/passwordreset/handler.go index d3753ab..1c2ccc2 100644 --- a/passwordreset/handler.go +++ b/passwordreset/handler.go @@ -15,7 +15,7 @@ import ( "go.inout.gg/shield/sender" "go.inout.gg/shield/user" "go.inout.gg/foundations/debug" - "go.inout.gg/foundations/internal/uuidv7" + "go.inout.gg/shield/internal/uuidv7" "go.inout.gg/foundations/must" "go.inout.gg/foundations/random" ) diff --git a/strategy/session/session.go b/strategy/session/session.go index c1e5a31..8ae4a0b 100644 --- a/strategy/session/session.go +++ b/strategy/session/session.go @@ -12,7 +12,7 @@ import ( "go.inout.gg/shield/internal/dbsqlc" "go.inout.gg/shield/strategy" "go.inout.gg/foundations/http/cookie" - "go.inout.gg/foundations/internal/uuidv7" + "go.inout.gg/shield/internal/uuidv7" "go.inout.gg/foundations/sql/db/dbutil" )