lib

package
v0.0.0-...-6189fb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2025 License: MIT Imports: 9 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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL