Documentation ¶
Index ¶
- func EncodeResponse(w http.ResponseWriter, code int, res interface{})
- type Controller
- func (c *Controller) CreateUser(w http.ResponseWriter, r *http.Request)
- func (c *Controller) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (c *Controller) ListUsers(w http.ResponseWriter, r *http.Request)
- func (c *Controller) ReadUser(w http.ResponseWriter, r *http.Request)
- func (c *Controller) UpdateUser(w http.ResponseWriter, r *http.Request)
- type Role
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeResponse ¶
func EncodeResponse(w http.ResponseWriter, code int, res interface{})
EncodeResponse ...
Types ¶
type Controller ¶
type Controller struct {
Users []User
}
Controller ...
func (*Controller) CreateUser ¶
func (c *Controller) CreateUser(w http.ResponseWriter, r *http.Request)
CreateUser ...
func (*Controller) DeleteUser ¶
func (c *Controller) DeleteUser(w http.ResponseWriter, r *http.Request)
DeleteUser ...
func (*Controller) ListUsers ¶
func (c *Controller) ListUsers(w http.ResponseWriter, r *http.Request)
ListUsers ...
func (*Controller) ReadUser ¶
func (c *Controller) ReadUser(w http.ResponseWriter, r *http.Request)
ReadUser ...
func (*Controller) UpdateUser ¶
func (c *Controller) UpdateUser(w http.ResponseWriter, r *http.Request)
UpdateUser ...
type Role ¶
type Role string
Role ...
const ( ROLEUSER Role = "ROLE_USER" ROLEADMIN = "ROLE_ADMIN" )
User Roles
type User ¶
type User struct { ID string `json:"id"` Username string `json:"username"` Password string `json:"password"` Fullname string `json:"fullname"` Mobile string `json:"mobile"` CreatedAt int64 `json:"createdAt"` ModifiedAt int64 `json:"modifiedAt"` Blocked bool `json:"blocked"` Roles []Role `json:"roles"` // contains filtered or unexported fields }
User ...
Click to show internal directories.
Click to hide internal directories.