refactor(app) agent refactoring + a little review

This commit is contained in:
imadev
2026-10-31 20:22:16 +03:00
parent 2ef20e7040
commit 362ba16cc4
25 changed files with 240 additions and 375 deletions
+10
View File
@@ -27,3 +27,13 @@ func SessionToken(c fiber.Ctx) (string, bool) {
token, ok := c.Locals(KeySessionToken).(string)
return token, ok && token != ""
}
// PathUUID parses a UUID path parameter. A malformed value is a contract
// invalid_request, not a lookup failure.
func PathUUID(c fiber.Ctx, name string) (uuid.UUID, error) {
id, err := uuid.Parse(c.Params(name))
if err != nil {
return uuid.Nil, BadRequest("invalid " + name + " format")
}
return id, nil
}