util

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUniqueID

func GenerateUniqueID() string

func GenerateUserToken

func GenerateUserToken() string

func GetIntDefault

func GetIntDefault(c echo.Context, param string, def int) int

func GetIntRange

func GetIntRange(c echo.Context, param string, min int, max int, def int) int

func HandleRequestAndRedirect

func HandleRequestAndRedirect(res http.ResponseWriter, req *http.Request)

func InitializeSecurity

func InitializeSecurity()

func LinkToWebp

func LinkToWebp(ctx context.Context, url string) ([]byte, error)

func OneOf

func OneOf(c echo.Context, param string, options []string, def string) string

func PutUint48

func PutUint48(b []byte, v uint64)

func RandomString

func RandomString(length int) string

func RandomStringWithCharset

func RandomStringWithCharset(length int, charset string) string

func ReWrapCtx

func ReWrapCtx(ctx context.Context) context.Context

ReWrapCtx re-wraps the old logger but with a new context

func RealIP

func RealIP(req *http.Request) string

Types

type ContextHeader

type ContextHeader struct{}

type ContextRequest

type ContextRequest struct{}

type ContextResponse

type ContextResponse struct{}

type ContextValidator

type ContextValidator struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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