helpers

package
v0.0.0-...-e137fcd Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decorate

func Decorate(ctx context.Context, kv ...any) context.Context

func FileUpload

func FileUpload(ctx context.Context, targetUrl string, headers map[string][]string, f io.Reader) error

func FromCtxInt

func FromCtxInt(ctx context.Context, key any, defaultValue int) int

func GET

func GET(ctx context.Context, targetUrl string, headers map[string][]string, params url.Values) ([]byte, error)

func GetOffsetAndLimit

func GetOffsetAndLimit(r *http.Request) (offset, limit int)

func GetVersion

func GetVersion(ctx context.Context) string

func IsHxRequest

func IsHxRequest(r *http.Request) bool

func PagerIndexes

func PagerIndexes(pageIndex, pageCount int) []int64

func SanitizeParams

func SanitizeParams(params url.Values, keys ...string)

func UrlParamOrDefault

func UrlParamOrDefault(r *http.Request, param, defaultValue string) string

func WithVersion

func WithVersion(ctx context.Context, version string) context.Context

func WriteComponentResponse

func WriteComponentResponse(ctx context.Context, w http.ResponseWriter, r *http.Request, component templ.Component, sizeHint int, cacheTime time.Duration)

Types

This section is empty.

Jump to

Keyboard shortcuts

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