Documentation ¶
Index ¶
- func DeleteUserFromSession(ctx *fiber.Ctx, sessionStore *session.Store) error
- func GetUserFromSession(ctx *fiber.Ctx, sessionStore *session.Store) (uint, error)
- func RenderTempl(c *fiber.Ctx, component templ.Component, ...) error
- func SetUserInSession(ctx *fiber.Ctx, sessionStore *session.Store, userID uint) error
- type AuthController
- type CompleteResourceController
- type HelloController
- type OrdersController
- type PostsController
- type RouteRegistrar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteUserFromSession ¶
Helper function to delete the user from the session
func GetUserFromSession ¶
Helper function to get the user from the session, if the user is not logged in, an error is returned.
func RenderTempl ¶
func RenderTempl(c *fiber.Ctx, component templ.Component, options ...func(*templ.ComponentHandler)) error
Types ¶
type AuthController ¶
type AuthController struct { Database *gorm.DB SessionStore *session.Store Environment *env.Env MailjetClient *mailjet.Client }
func (*AuthController) RegisterRoutes ¶
func (ctrl *AuthController) RegisterRoutes(app *fiber.App)
RegisterRoutes registers the auth-related routes
type CompleteResourceController ¶
type CompleteResourceController interface {
// contains filtered or unexported methods
}
CompleteResourceController is an interface that defines the methods that a controller must implement
type HelloController ¶
type HelloController struct{}
func (*HelloController) RegisterRoutes ¶
func (ctrl *HelloController) RegisterRoutes(app *fiber.App)
type OrdersController ¶
func (*OrdersController) RegisterRoutes ¶
func (ctrl *OrdersController) RegisterRoutes(app *fiber.App)
type PostsController ¶
type PostsController struct { Database *gorm.DB SessionStore *session.Store } // Implements RouteRegistrar and CoreHandler
func (*PostsController) RegisterRoutes ¶
func (ctrl *PostsController) RegisterRoutes(app *fiber.App)
type RouteRegistrar ¶
type RouteRegistrar interface {
RegisterRoutes(app *fiber.App)
}
RouteRegistrar is an interface that defines the method that a route registrar must implement
Click to show internal directories.
Click to hide internal directories.