utils

package
v0.0.0-...-823f4d2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 8 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, tbox, abox *rice.Box, verbose bool, names ...string) error

InitAssetsTemplates initializes the router to use either a ricebox or the filesystem in case the ricebox couldn't be found.

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