Add first helper method to user

This commit is contained in:
Melody Becker 2025-04-04 13:46:11 +02:00
parent f3a139b809
commit 11e0059631
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
6 changed files with 16 additions and 7 deletions

View file

@ -4,6 +4,7 @@ import (
"database/sql"
"time"
"gorm.io/gen"
"gorm.io/gorm"
)
@ -76,3 +77,10 @@ type User struct {
RemoteInfo *UserRemoteLinks
AuthMethods []UserAuthMethod
}
type IUser interface {
// Get a user by a username
//
// SELECT * FROM @@table WHERE username = @username LIMIT 1
GetByUsername(username string) (*gen.T, error)
}