wsutil

package
v0.0.0-...-d931726 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrInternalOrNotFound

func ErrInternalOrNotFound(err error) error

ErrInternalOrNotFound returns a fiber not found error when the passed error is a ErrDatabaseNotFound error. Otherwise, the passed error is returned unchanged.

func GetFS

func GetFS() (f http.FileSystem, err error)

func GetQueryBool

func GetQueryBool(ctx *fiber.Ctx, key string, def bool) (bool, error)

GetQueryBool tries to get a value from request query and transforms it to an bool value.

If the query value is not provided, def is returened.

Valid string values for <true> are 'true', '1' or 'yes. Valid values for <false> are 'false', '0' or 'no'.

Returned errors are in form of fiber errors with appropriate error codes.

func GetQueryInt

func GetQueryInt(ctx *fiber.Ctx, key string, def, min, max int) (int, error)

GetQueryInt tries to get a value from request query and transforms it to an integer value.

If the query value is not provided, def is returened.

If the integer value is smaller than min or larger than max (if max is larger than 0), a bounds error is returned.

Returned errors are in form of fiber errors with appropriate error codes.

func ParseBase64Data

func ParseBase64Data(b64Data string) (mime string, data []byte, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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