web

package
v0.0.0-...-ba1867d Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(c *gin.Context)

ErrorHandler handles internal server errors

func HandleError

func HandleError(c *gin.Context, status int, message string)

HandleError renders the error page with the given status and message

func HealthHandler

func HealthHandler(c *gin.Context)

HealthHandler handles health check requests

func Listen

func Listen(host, port, webPath string) error

func NotFoundHandler

func NotFoundHandler(c *gin.Context)

NotFoundHandler handles 404 errors

func RootHandler

func RootHandler(c *gin.Context)

RootHandler handles the root route

Types

type PageData

type PageData struct {
	Title       string                 `json:"title"`
	Description string                 `json:"description,omitempty"`
	Data        map[string]interface{} `json:"data,omitempty"`
	WebPath     string                 `json:"web_path"`
}

PageData represents the data passed to HTML templates

func NewPageData

func NewPageData() PageData

NewPageData creates a new page data instance with defaults

Jump to

Keyboard shortcuts

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