Documentation
¶
Index ¶
- Variables
- func NewGoogleAuthenticationRoutes(router net.AppRouter, gAuthService service.GoogleAuthenicationService, ...) *googleAuthenticationRoutes
- func NewJsonWebTokenAuthenticationRoutes(router net.AppRouter, authService service.AuthenticationService, ...) *jwtAuthRoutes
- func NewJsonWebTokenUserRoutes(router net.AppRouter, userRepository repository.UserRepository, ...) jwtUserRoutes
- type UserContextHelpers
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMissingUserContext = errors.New("no user context provided") // ErrMissingUserContext is returned when no context is found while attempting to load user from http.Requests context.
)
Functions ¶
func NewGoogleAuthenticationRoutes ¶
func NewGoogleAuthenticationRoutes(router net.AppRouter, gAuthService service.GoogleAuthenicationService, jwtAuthService service.AuthenticationService, lw logging.LogWriter) *googleAuthenticationRoutes
NewGoogleAuthenticationRoutes creates routes using GoogleAuthenicationService and mounts them to the provided router.
func NewJsonWebTokenAuthenticationRoutes ¶
func NewJsonWebTokenAuthenticationRoutes(router net.AppRouter, authService service.AuthenticationService, jwtService *service.JsonWebTokenService, lw logging.LogWriter) *jwtAuthRoutes
NewJsonWebTokenAuthenticationRoutes creates routes using AuthenticationService and JsonWebTokenService then mounts them to the provided router.
func NewJsonWebTokenUserRoutes ¶
func NewJsonWebTokenUserRoutes(router net.AppRouter, userRepository repository.UserRepository, jwtService *service.JsonWebTokenService, lw logging.LogWriter) jwtUserRoutes
NewJsonWebTokenUserRoutes creates routes using UserRepository and JsonWebTokenService then mounts them to the provided router.
Types ¶
type UserContextHelpers ¶
type UserContextHelpers struct {
// contains filtered or unexported fields
}
func (UserContextHelpers) LoadUserFromContext ¶
LoadUserFromContext helper that attempts to read the http.Request's user context key or returns an error if it was not found.
func (UserContextHelpers) LoadUserFromContextWithRole ¶
Click to show internal directories.
Click to hide internal directories.