httptils

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type D

type D map[string]any

type HTMLFunc

type HTMLFunc func(context.Context, *http.Request) (int, string, D, error)

type HTMLHandler

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

func NewHTMLHandler

func NewHTMLHandler(ctx context.Context, tmpl *template.Template) *HTMLHandler

func (*HTMLHandler) H

func (*HTMLHandler) SetErrorTemplateName

func (h *HTMLHandler) SetErrorTemplateName(name string)

func (*HTMLHandler) SetSLogger

func (h *HTMLHandler) SetSLogger(logger *slog.Logger)

type JSONFunc

type JSONFunc func(context.Context, *http.Request) (int, any, error)

type JSONHandler

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

func NewJSONHandler

func NewJSONHandler(ctx context.Context) *JSONHandler

func (*JSONHandler) H

func (*JSONHandler) SetSlogger

func (h *JSONHandler) SetSlogger(logger *slog.Logger)

type JSONResponse

type JSONResponse[T any] struct {
	Data  T      `json:"data"`
	Error string `json:"error"`
}

Jump to

Keyboard shortcuts

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