Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticationHandler ¶
type AuthenticationHandler struct { user.UserService AuthenticationService config.Config *validator.Validate }
func NewAuthenticationHandler ¶
func NewAuthenticationHandler(userService user.UserService, authenticationService AuthenticationService, config config.Config, validate *validator.Validate) AuthenticationHandler
func (*AuthenticationHandler) Login ¶
func (h *AuthenticationHandler) Login(ctx *gin.Context)
type AuthenticationRequest ¶
type AuthenticationResponse ¶
type AuthenticationService ¶
type AuthenticationService interface { CreateAuthentication(ctx context.Context, req AuthenticationRequest) (db.AuthenticationToken, error) GetByAccessToken(ctx context.Context, token string) (db.AuthenticationToken, error) }
func NewAuthenticationService ¶
func NewAuthenticationService(datastore db.DataStore) AuthenticationService
type AuthenticationServiceImpl ¶
type AuthenticationServiceImpl struct {
// contains filtered or unexported fields
}
func (*AuthenticationServiceImpl) CreateAuthentication ¶
func (service *AuthenticationServiceImpl) CreateAuthentication(ctx context.Context, req AuthenticationRequest) (db.AuthenticationToken, error)
func (*AuthenticationServiceImpl) GetByAccessToken ¶
func (service *AuthenticationServiceImpl) GetByAccessToken(ctx context.Context, token string) (db.AuthenticationToken, error)
type LoginRequest ¶
type LoginRequest struct { Email string `json:"email" validate:"required,email"` Password string `json:"password" validate:"required"` }
Uses https://github.com/go-playground/validator for validation
Click to show internal directories.
Click to hide internal directories.