Discover Packages
github.com/cmcd97/bytesize
lib
package
Version:
v0.0.0-...-6189fb2
Opens a new window with list of versions in this module.
Published: Jan 4, 2025
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: ? modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Jump to ...
README
Documentation
Index
Constants
Variables
Functions
HtmxRedirect(c, path)
HtmxRender(c, htmxTemplate, nonHtmxTemplate)
IsHtmxRequest(c)
Login(e, c, username, password)
Register(e, c, username, password, passwordRepeat)
Render(ctx, status, t)
Types
Source Files
README
README
¶
Lib Package
The lib directory contains reusable code essential for the application.
auth.go : Manages user authentication, including:
Login: Validates user credentials.
Register: Ensures unique usernames and matching passwords before creating a new user.
setAuthToken: Generates and sets an authentication token as an HTTP cookie.
base.templ : Defines the base HTML layout, including:
Essential metadata, stylesheets, and scripts.
Uses Tailwind CSS, DaisyUI, and HTMX.
{ children... } placeholder for dynamic content.
htmx.go : Provides utilities for handling HTMX requests, including:
Checking if a request is an HTMX request.
Rendering templates based on request type.
Handling HTMX-specific redirects.
render.go : Renders Templ components in an Echo context, including:
Setting the HTTP status code.
Rendering the Templ component to the response writer.
Returning a 500 Internal Server Error if rendering fails.
Expand ▾
Collapse ▴
Documentation
¶
func HtmxRedirect(c echo.Context, path string) error
func HtmxRender(c echo.Context, htmxTemplate TemplRenderFunc, nonHtmxTemplate TemplRenderFunc) templ.Component
func IsHtmxRequest(c echo.Context) bool
func Login(e *core.ServeEvent, c echo.Context, username string, password string) error
func Register(e *core.ServeEvent, c echo.Context, username string, password string, ...) error
func Render(ctx echo.Context, status int, t templ.Component) error
type TemplRenderFunc
type Users
Source Files
¶
Click to show internal directories.
Click to hide internal directories.