Documentation
¶
Index ¶
- Variables
- func AuthMiddleware(service Service) echo.MiddlewareFunc
- func CheckCurrentSession(res http.ResponseWriter, req *http.Request) (us session.UserSession, err error)
- func GetUserFromCtx(ctx context.Context) *user.User
- func Module() fx.Option
- func SetOAuthAPIRoutes(server *echo.Echo, handler *OAuthHandler)
- type MiddlewareCtxKey
- type OAuth
- type OAuthHandler
- type OAuthService
- type Provider
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidProvider = errors.New("not a valid Provider")
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(service Service) echo.MiddlewareFunc
func CheckCurrentSession ¶
func CheckCurrentSession(res http.ResponseWriter, req *http.Request) (us session.UserSession, err error)
func SetOAuthAPIRoutes ¶
func SetOAuthAPIRoutes(server *echo.Echo, handler *OAuthHandler)
Types ¶
type MiddlewareCtxKey ¶
type MiddlewareCtxKey string
const (
MiddlewareUserKey MiddlewareCtxKey = "user"
)
type OAuthHandler ¶
type OAuthHandler struct {
// contains filtered or unexported fields
}
func NewOAuthHandler ¶
func NewOAuthHandler(service Service) *OAuthHandler
func (*OAuthHandler) AuthCallback ¶
func (h *OAuthHandler) AuthCallback(c echo.Context) (err error)
func (*OAuthHandler) AuthLogin ¶
func (h *OAuthHandler) AuthLogin(c echo.Context) (err error)
func (*OAuthHandler) AuthLogout ¶
func (h *OAuthHandler) AuthLogout(c echo.Context) (err error)
type OAuthService ¶
type OAuthService struct {
// contains filtered or unexported fields
}
type Provider ¶
type Provider int
ENUM(github)
func ParseProvider ¶
ParseProvider attempts to convert a string to a Provider.
func (Provider) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (Provider) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Provider) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
Click to show internal directories.
Click to hide internal directories.