Documentation ¶
Index ¶
- type LoginRequest
- type LoginUser
- type RegisterRequest
- type RegisterUser
- type Response
- type Server
- func (s *Server) HandleUserGet(w http.ResponseWriter, r *http.Request) error
- func (s *Server) HandleUserLogin(w http.ResponseWriter, r *http.Request) error
- func (s *Server) HandleUserRegister(w http.ResponseWriter, r *http.Request) error
- func (s *Server) HandleUserUpdate(w http.ResponseWriter, r *http.Request) error
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type Service
- type Store
- type UpdateRequest
- type UpdateUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoginRequest ¶
type LoginRequest struct {
User LoginUser `json:"user"`
}
LoginRequest describes request JSON for login handler
func (*LoginRequest) Validate ¶
func (r *LoginRequest) Validate() error
type RegisterRequest ¶
type RegisterRequest struct {
User RegisterUser `json:"user"`
}
func (*RegisterRequest) Validate ¶
func (r *RegisterRequest) Validate() error
type RegisterUser ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) HandleUserGet ¶
HandleUserGet gets the currently logged-in user. Requires authentication.
func (*Server) HandleUserLogin ¶
func (*Server) HandleUserRegister ¶
func (*Server) HandleUserUpdate ¶
HandleUserUpdate changes currently logged-in user. Requires authentication.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides a service for interacting with user accounts
func NewService ¶
NewService creates new instance of the service with provided store
func (*Service) Login ¶
func (s *Service) Login(req *LoginRequest) (*app.User, error)
Login checks the user request and logins the user
type UpdateRequest ¶
type UpdateRequest struct {
User UpdateUser `json:"user"`
}
func (*UpdateRequest) Validate ¶
func (r *UpdateRequest) Validate() error
Click to show internal directories.
Click to hide internal directories.