Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { *controller.Controller // contains filtered or unexported fields }
Controller provides the end point for the routers.
func NewController ¶
func NewController(jwt *auth.JWT, service Service) *Controller
NewController creates a new instance of Controller.
func (*Controller) Login ¶
func (c *Controller) Login(w http.ResponseWriter, r *http.Request)
Login returns a token if ID and password are valid. Login end point for route .../login [POST method]
func (*Controller) Update ¶
func (c *Controller) Update(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Update updates password in data base. Update end point for route .../login [PUT method]
type DAO ¶
DAO interface for login data source.
func NewPostgresDAO ¶
NewPostgresDAO creates a new instance of DAO.
type Repository ¶
Repository interface for login data source.
func NewRepository ¶
func NewRepository(dao DAO) Repository
NewRepository creates a new instance of Repository.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router for Login end points.
func NewRoutes ¶
func NewRoutes(controller *Controller, auth *middleware.Auth) *Router
NewRoutes creates a router for Login.
type Service ¶
Service provides business rules for the controller layer.
func NewService ¶
func NewService(repository Repository, jwt *auth.JWT) Service
NewService creates a new instance of Service.