Some checks failed
build-docker-imge / Build the docker container (push) Failing after 2m24s
37 lines
934 B
Go
37 lines
934 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type LoginParams struct {
|
|
LoginName string `json:"loginname"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type RegisterParams struct {
|
|
Username string `json:"username"`
|
|
FirstName string `json:"firstname"`
|
|
LastName string `json:"lastname"`
|
|
LoginName string `json:"loginname"`
|
|
EmailAddress string `json:"emailaddress"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type User struct {
|
|
Username string `json:"username"`
|
|
FirstName string `json:"firstname"`
|
|
LastName string `json:"lastname"`
|
|
LoginName string `json:"loginname"`
|
|
EmailAddress string `json:"email"`
|
|
Password []byte
|
|
}
|
|
|
|
type AuthRepository interface {
|
|
GetUserByToken(ctx context.Context, userId uuid.UUID) (User, error)
|
|
Login(ctx context.Context, loginParams *LoginParams) (uuid.UUID, error)
|
|
Register(ctx context.Context, registerParams *RegisterParams) (bool, error)
|
|
}
|