23 lines
444 B
Go
23 lines
444 B
Go
package repository
|
|
|
|
import (
|
|
"authorization/internal"
|
|
"database/sql"
|
|
)
|
|
|
|
type UserResository interface {
|
|
CreateUser(user internal.User) (int, error)
|
|
GetUser(username, password string) (internal.User, error)
|
|
UpdateUserRole(username string, userrole internal.UserRole) (string, error)
|
|
}
|
|
|
|
type Repository struct {
|
|
UserResository
|
|
}
|
|
|
|
func NewRepository(db *sql.DB) *Repository {
|
|
return &Repository{
|
|
UserResository: NewUserPostgres(db),
|
|
}
|
|
}
|