common

package
v0.0.0-...-72464e7 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectMimeType

func DetectMimeType(input io.Reader) (mimeType string, recycled io.Reader, err error)

func FillViewModel

func FillViewModel[T any](ctx context.Context, vmodel *T, r *http.Request, funcs ...viewModelFillerFunc[T]) error

func HandleError

func HandleError(w http.ResponseWriter, r *http.Request, err error)

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(err string, userMessage string, statusCode int) *Error

func (*Error) Error

func (e *Error) Error() string

Error implements UserFacingError.

func (*Error) StatusCode

func (e *Error) StatusCode() int

StatusCode implements HTTPError.

func (*Error) UserMessage

func (e *Error) UserMessage() string

UserMessage implements UserFacingError.

type HTTPError

type HTTPError interface {
	error
	StatusCode() int
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler() *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type UserFacingError

type UserFacingError interface {
	error
	UserMessage() string
}

Directories

Path Synopsis
templ: version: v0.3.833
templ: version: v0.3.833

Jump to

Keyboard shortcuts

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