utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiloByte = 1024.0
	MegaByte = 1024 * KiloByte
	GigaByte = 1024 * MegaByte
	TeraByte = 1024 * GigaByte
)

Exported values

Variables

This section is empty.

Functions

func DetectScheme

func DetectScheme(c *gin.Context) string

DetectScheme allows to detect the scheme of a request

func HumanBytes

func HumanBytes(bytes uint64) string

HumanBytes returns a human readable size

func InitAssetsTemplates

func InitAssetsTemplates(r *gin.Engine, verbose bool, names ...string) error

InitAssetsTemplates initializes the router to use embedded assets

func ServerName

func ServerName() string

ServerName returns the configured hostname (and port) of the server

func ServerURI

func ServerURI(c *gin.Context) string

ServerURI returns the full URI to the server including scheme

Types

This section is empty.

Jump to

Keyboard shortcuts

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