server

package
v0.0.0-...-d787f02 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler() echo.HTTPErrorHandler

ErrorHandler is Echo server's error handler. It renders HTML error pages and logs errors.

func Logger

func Logger(c echo.Context) *slog.Logger

Logger returns a logger with attributes populated from echo context.

func NewServer

func NewServer() *echo.Echo

NewServer creates a new calendar server.

func NewSessionManager

func NewSessionManager(store scs.Store) *scs.SessionManager

NewSessionManager creates a new session manager.

func NewSessionMiddleware

func NewSessionMiddleware(sm *scs.SessionManager) echo.MiddlewareFunc

NewSessionMiddleware creates a new session middleware.

func Recover

func Recover() echo.MiddlewareFunc

Recover returns a middleware which recovers from panics anywhere in the chain and returns an error with stack trace.

func RenderPage

func RenderPage(
	c *Context,
	sm *scs.SessionManager,
	content gomponents.Node,
) error

RenderPage renders a HTML page.

func Wrap

func Wrap(db *bun.DB, sm *scs.SessionManager, next HandlerFunc) echo.HandlerFunc

Wrap a HandlerFunc with echo.HandlerFunc.

Types

type Context

type Context struct {
	echo.Context

	User     *domain.User
	Settings *domain.Settings
	CSRF     string
}

Context is the request context.

type HandlerFunc

type HandlerFunc func(*Context) error

HandlerFunc defines a function to serve HTTP requests, using the custom context.

Jump to

Keyboard shortcuts

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