Documentation
¶
Index ¶
- type User
- type UserController
- type UserRepository
- func (repo *UserRepository) AddDataAccesser(dao webapp.DataAccesser)
- func (repo *UserRepository) AddUser(u *User) (int, error)
- func (repo *UserRepository) Del(id int) error
- func (repo *UserRepository) GetAllUsers(ptr []*User) (int, error)
- func (repo *UserRepository) GetUser(id int, ptr *User) error
- func (repo *UserRepository) SetUser(u *User) error
- type UserService
- type WiredUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
ID int
FirstName string
LastName string
EmailAddress string
Password string
IsActive bool
}
User is a user model
func (*User) UpdatePassword ¶
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController implements the Controller interface for use with the standard library http package
func (*UserController) AddService ¶
func (con *UserController) AddService(service webapp.Servicer)
AddService helps satisfy the Controller interface
func (*UserController) HandleBase ¶
func (con *UserController) HandleBase() http.Handler
HandleBase helps satisfy the Controller interface
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository implements the Repository interface and provides methods for the service to use
func (*UserRepository) AddDataAccesser ¶
func (repo *UserRepository) AddDataAccesser(dao webapp.DataAccesser)
AddDataAccesser helps satisfy the Repository interface
func (*UserRepository) Del ¶
func (repo *UserRepository) Del(id int) error
func (*UserRepository) GetAllUsers ¶
func (repo *UserRepository) GetAllUsers(ptr []*User) (int, error)
func (*UserRepository) SetUser ¶
func (repo *UserRepository) SetUser(u *User) error
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService implements the Servicer interface and provides methods for the controller to use
func (*UserService) AddNewUser ¶
func (service *UserService) AddNewUser(r *http.Request) (int, error)
func (*UserService) AddRepository ¶
func (service *UserService) AddRepository(repo webapp.Repository)
AddRepository helps satisfy the Servicer interface
func (*UserService) GetUser ¶
func (service *UserService) GetUser(un, pw string) *User
type WiredUser ¶
type WiredUser struct {
*UserRepository
*UserService
*UserController
}
func WireUser ¶
func WireUser(dao webapp.DataAccesser) *WiredUser
Click to show internal directories.
Click to hide internal directories.