utils

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 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 added in v0.3.5

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