utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package utils has general utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountDecimal

func ByteCountDecimal(b int64) string

ByteCountDecimal generates human readable file sizes and returns a string

func GetAllIPAdresses

func GetAllIPAdresses() (map[string]string, error)

GetAllIPAdresses will return a map of interface and associated ipv4 addresses for displaying reasons

func GetInterfaceIpv4Addr

func GetInterfaceIpv4Addr(interfaceName string) (addr string, err error)

GetInterfaceIpv4Addr will return the ip address by name

func HashPassword

func HashPassword()

HashPassword will take a plaintext masked password and return a bcrypt hash This is meant to be used with the filebased access via .goshs file

func MimeByExtension

func MimeByExtension(n string) string

MimeByExtension returns the mimetype string depending on the filename and its extension

func RandomNumber

func RandomNumber() (big.Int, error)

RandomNumber returns a random int64

func ReturnExt

func ReturnExt(n string) string

ReturnExt returns the extension without from a filename

Types

This section is empty.

Jump to

Keyboard shortcuts

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