Documentation ¶
Overview ¶
Package user contains user application services
Index ¶
- type RBAC
- type Securer
- type Service
- type UDB
- type Update
- type User
- func (u User) Create(c echo.Context, req homeschooling.User) (homeschooling.User, error)
- func (u User) Delete(c echo.Context, id int) error
- func (u User) List(c echo.Context, p homeschooling.Pagination) ([]homeschooling.User, error)
- func (u User) Update(c echo.Context, r Update) (homeschooling.User, error)
- func (u User) View(c echo.Context, id int) (homeschooling.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RBAC ¶
type RBAC interface { User(echo.Context) homeschooling.AuthUser EnforceUser(echo.Context, int) error AccountCreate(echo.Context, homeschooling.AccessRole, int, int) error IsLowerRole(echo.Context, homeschooling.AccessRole) error }
RBAC represents role-based-access-control interface
type Service ¶
type Service interface { Create(echo.Context, homeschooling.User) (homeschooling.User, error) List(echo.Context, homeschooling.Pagination) ([]homeschooling.User, error) View(echo.Context, int) (homeschooling.User, error) Delete(echo.Context, int) error Update(echo.Context, Update) (homeschooling.User, error) }
Service represents user application interface
type UDB ¶
type UDB interface { Create(orm.DB, homeschooling.User) (homeschooling.User, error) View(orm.DB, int) (homeschooling.User, error) List(orm.DB, *homeschooling.ListQuery, homeschooling.Pagination) ([]homeschooling.User, error) Update(orm.DB, homeschooling.User) error Delete(orm.DB, homeschooling.User) error }
UDB represents user repository interface
type Update ¶
type Update struct { ID int FirstName string LastName string Mobile string Phone string Address string }
Update contains user's information used for updating
type User ¶
type User struct {
// contains filtered or unexported fields
}
User represents user application service
func Initialize ¶
Initialize initalizes User application service with defaults
func (User) Create ¶
func (u User) Create(c echo.Context, req homeschooling.User) (homeschooling.User, error)
Create creates a new user account
func (User) List ¶
func (u User) List(c echo.Context, p homeschooling.Pagination) ([]homeschooling.User, error)
List returns list of users
Click to show internal directories.
Click to hide internal directories.