Documentation ¶
Index ¶
- func ErrorMessage(status int, msg string) string
- type UserHandler
- func (uh *UserHandler) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) GetUser(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) GetUsers(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) InsertUser(w http.ResponseWriter, r *http.Request)
- func (uh *UserHandler) UpdateUser(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorMessage ¶
ErrorMessage return error message as json string
Types ¶
type UserHandler ¶ added in v0.1.2
type UserHandler struct {
// contains filtered or unexported fields
}
UserHandler struct
func NewUserHandler ¶
func NewUserHandler(db *sqlx.DB) *UserHandler
NewUserHandler return new UserHandler object
func (*UserHandler) DeleteUser ¶ added in v0.1.2
func (uh *UserHandler) DeleteUser(w http.ResponseWriter, r *http.Request)
DeleteUser delete user
func (*UserHandler) GetUser ¶ added in v0.1.2
func (uh *UserHandler) GetUser(w http.ResponseWriter, r *http.Request)
GetUser return user by id
func (*UserHandler) GetUsers ¶ added in v0.1.2
func (uh *UserHandler) GetUsers(w http.ResponseWriter, r *http.Request)
GetUsers return all users
func (*UserHandler) InsertUser ¶ added in v0.1.2
func (uh *UserHandler) InsertUser(w http.ResponseWriter, r *http.Request)
InsertUser insert new user into database
func (*UserHandler) UpdateUser ¶ added in v0.1.2
func (uh *UserHandler) UpdateUser(w http.ResponseWriter, r *http.Request)
UpdateUser update user
Click to show internal directories.
Click to hide internal directories.