Documentation ¶
Index ¶
- func Authorize(s *Service) echo.MiddlewareFunc
- func BackDoor(cfg *config.Config, s *Service) echo.MiddlewareFunc
- func ExpireCookie() *http.Cookie
- func NewCookie(token string) *http.Cookie
- type HTTPServer
- type Model
- type Service
- func (s *Service) CreateUser(ctx context.Context, email, pass string) (*Model, error)
- func (s *Service) GetUser(ctx context.Context, email string) (*Model, error)
- func (s *Service) Login(ctx context.Context, email string, password string) (*Model, error)
- func (s *Service) ResetPassword(ctx context.Context, token string) error
- func (s *Service) SignOut(ctx context.Context, token string) error
- func (s *Service) UpdatePassword(ctx context.Context, id, token, password string) error
- func (s *Service) Validate(ctx context.Context, token string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpireCookie ¶
ExpireCookie creates a new cookie with Expires set to now
Types ¶
type HTTPServer ¶
type HTTPServer struct {
Service *Service
}
func NewHTTPServer ¶
func NewHTTPServer(svc *Service) *HTTPServer
func (*HTTPServer) RouteTo ¶
func (h *HTTPServer) RouteTo(e *echo.Echo, auth echo.MiddlewareFunc)
type Model ¶
type Model struct { ID int `json:"id" db:"id"` Email string `json:"email" db:"email"` EncryptedPassword string `json:"-" db:"encrypted_password"` RememberToken string `json:"-" db:"remember_token"` ConfirmationToken string `json:"-" db:"confirmation_token "` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` CreatedAt time.Time `json:"created_at" db:"created_at"` }
Model is a struct that represents the user data
type Service ¶
func NewService ¶
func (*Service) CreateUser ¶
func (*Service) ResetPassword ¶
func (*Service) UpdatePassword ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.