Add first helper method to user
This commit is contained in:
parent
f3a139b809
commit
11e0059631
6 changed files with 16 additions and 7 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue