Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultipleRoleResponse ¶
type MultipleRoleResponse struct {
Roles []Role `json:"roles"`
}
func (*MultipleRoleResponse) Render ¶
func (resp *MultipleRoleResponse) Render(w http.ResponseWriter, r *http.Request) error
type RoleCreationRequest ¶
type RoleHandler ¶
type RoleHandler interface { Routes() chi.Router SearchByVisibleName(w http.ResponseWriter, r *http.Request) Get(w http.ResponseWriter, r *http.Request) Create(w http.ResponseWriter, r *http.Request) Update(w http.ResponseWriter, r *http.Request) Delete(w http.ResponseWriter, r *http.Request) }
func NewRoleHandler ¶
func NewRoleHandler(r chi.Router, db *sqlx.DB) RoleHandler
type RoleService ¶
type RoleService interface { SearchByVisibleName(name string) ([]Role, error) Get(name string) (*Role, error) Create(req *RoleCreationRequest) error Update(name string, req *RoleUpdateRequest) error Delete(name string) error }
func NewRoleService ¶
func NewRoleService(db *sqlx.DB) RoleService
type RoleUpdateRequest ¶
type RoleUpdateRequest struct {
VisibleName string `json:"visibleName" db:"visible_name" validate:"required,max=255"`
}
type SingleRoleResponse ¶
type SingleRoleResponse struct {
Role Role `json:"role"`
}
func (*SingleRoleResponse) Render ¶
func (resp *SingleRoleResponse) Render(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.