Documentation
¶
Index ¶
- type Controller
- func (c *Controller) DeleteUser(w http.ResponseWriter, r *http.Request)
- func (c *Controller) GetUser(w http.ResponseWriter, r *http.Request)
- func (c *Controller) Mux() *mux.Router
- func (c *Controller) NewUser(w http.ResponseWriter, r *http.Request)
- func (c *Controller) UpdateUser(w http.ResponseWriter, r *http.Request)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func New ¶
func New(service Service) *Controller
func (*Controller) DeleteUser ¶
func (c *Controller) DeleteUser(w http.ResponseWriter, r *http.Request)
func (*Controller) GetUser ¶
func (c *Controller) GetUser(w http.ResponseWriter, r *http.Request)
func (*Controller) Mux ¶ added in v0.4.3
func (c *Controller) Mux() *mux.Router
func (*Controller) NewUser ¶
func (c *Controller) NewUser(w http.ResponseWriter, r *http.Request)
func (*Controller) UpdateUser ¶
func (c *Controller) UpdateUser(w http.ResponseWriter, r *http.Request)
type Service ¶
type Service interface {
FindUser(ctx context.Context, id string) (model.User, error)
CreateUser(ctx context.Context, user model.User) (model.User, error)
UpdateUser(ctx context.Context, user model.User) (model.User, error)
DeleteUser(ctx context.Context, id string) error
}
Service abstracts the service layer.
Click to show internal directories.
Click to hide internal directories.