diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2025-02-22 09:59:10 -0500 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2025-02-22 09:59:10 -0500 |
commit | f36f77472a82d6ebfac153aed6d17f154ae239a6 (patch) | |
tree | d749ecc2ebf86a39b15ac3026d3e100d0276442b /internal/tagging | |
parent | 2cb9e5fe823391c09a99424138192d0fbec727af (diff) |
Good foundations
Diffstat (limited to 'internal/tagging')
-rw-r--r-- | internal/tagging/tagging.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/internal/tagging/tagging.go b/internal/tagging/tagging.go deleted file mode 100644 index 8e8efe9..0000000 --- a/internal/tagging/tagging.go +++ /dev/null @@ -1,23 +0,0 @@ -package tagging - -import ( - "context" - "log/slog" - - "github.com/ChausseBenjamin/rafta/internal/logging" - "github.com/ChausseBenjamin/rafta/internal/util" - "github.com/hashicorp/go-uuid" - "google.golang.org/grpc" -) - -// gRPC interceptor to tag requests with a unique identifier -func UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - id, err := uuid.GenerateUUID() - if err != nil { - slog.Error("Unable to generate UUID for request", logging.ErrKey, err) - } - ctx = context.WithValue(ctx, util.ReqIDKey, id) - slog.DebugContext(ctx, "Tagging request with UUID", "value", id) - - return handler(ctx, req) -} |