login_attempt.go 500 B

123456789101112131415161718192021222324252627282930313233343536
  1. package models
  2. import (
  3. "time"
  4. )
  5. type LoginAttempt struct {
  6. Id int64
  7. Username string
  8. IpAddress string
  9. Created int64
  10. }
  11. // ---------------------
  12. // COMMANDS
  13. type CreateLoginAttemptCommand struct {
  14. Username string
  15. IpAddress string
  16. Result LoginAttempt
  17. }
  18. type DeleteOldLoginAttemptsCommand struct {
  19. OlderThan time.Time
  20. DeletedRows int64
  21. }
  22. // ---------------------
  23. // QUERIES
  24. type GetUserLoginAttemptCountQuery struct {
  25. Username string
  26. Since time.Time
  27. Result int64
  28. }