Documentation
¶
Index ¶
- Variables
- type Handler
- type Repository
- func (rpo *Repository) CheckRefreshToken(ctx context.Context, tx *sql.Tx, userID string, userAgent string) (*model.AuthSession, error)
- func (rpo *Repository) RevokeSession(ctx context.Context, tx *sql.Tx, userID string, userAgent string)
- func (rpo *Repository) SaveSession(ctx context.Context, tx *sql.Tx, data *model.AuthSession)
- type Router
- type Service
- func (svc *Service) GetAccessToken(ctx context.Context, claims jwt.MapClaims, userAgent string) model.TokenResponse
- func (svc *Service) Login(ctx context.Context, request *model.LoginRequest, userAgent string) model.TokenResponse
- func (svc *Service) Logout(ctx context.Context, claims jwt.MapClaims, userAgent string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProviderSet = wire.NewSet( ProvideRoute, ProvideHandler, ProvideService, ProvideRepository, user.ProvideRepository, permission.ProvideRepository, wire.Bind(new(model.AuthSessionHandler), new(*Handler)), wire.Bind(new(model.AuthSessionService), new(*Service)), wire.Bind(new(model.AuthSessionRepository), new(*Repository)), wire.Bind(new(model.UserRepository), new(*user.Repository)), wire.Bind(new(model.PermissionRepository), new(*permission.Repository)), ) )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func ProvideHandler ¶
func ProvideHandler(svc model.AuthSessionService, validate *validator.Validate) *Handler
func (*Handler) GetAccessToken ¶
func (hdl *Handler) GetAccessToken() http.HandlerFunc
func (*Handler) Login ¶
func (hdl *Handler) Login() http.HandlerFunc
func (*Handler) Logout ¶
func (hdl *Handler) Logout() http.HandlerFunc
type Repository ¶
type Repository struct{}
func ProvideRepository ¶
func ProvideRepository() *Repository
func (*Repository) CheckRefreshToken ¶
func (rpo *Repository) CheckRefreshToken(ctx context.Context, tx *sql.Tx, userID string, userAgent string) (*model.AuthSession, error)
func (*Repository) RevokeSession ¶
func (*Repository) SaveSession ¶
func (rpo *Repository) SaveSession(ctx context.Context, tx *sql.Tx, data *model.AuthSession)
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func ProvideRoute ¶
func ProvideRoute(hdl model.AuthSessionHandler) *Router
func (*Router) InitializeRoutes ¶
func (router *Router) InitializeRoutes(route chi.Router)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func ProvideService ¶
func ProvideService(rpo model.AuthSessionRepository, urpo model.UserRepository, prpo model.PermissionRepository, db *sql.DB) *Service
func (*Service) GetAccessToken ¶
func (*Service) Login ¶
func (svc *Service) Login(ctx context.Context, request *model.LoginRequest, userAgent string) model.TokenResponse
Click to show internal directories.
Click to hide internal directories.