Files
Aurélie Delhaie c06843cd28 Start refactoring
2023-05-29 17:44:50 +02:00

37 lines
574 B
Go

package user
import (
"errors"
"github.com/google/uuid"
)
type (
UserRepository interface {
UserByID(ID ID) (User, error)
UserByUsername(username string) (User, error)
CreateUser(user NewUserTemplate) (User, error)
}
User interface {
ID() uuid.UUID
Username() string
DisplayName() string
Roles() []Role
SetPassword() string
CheckPassword(password string) bool
}
NewUserTemplate interface {
Username() string
Password() string
DisplayName() string
}
ID uuid.UUID
Role string
)
var (
ErrUserNotFound = errors.New("user not found")
)