utils

package module
v0.0.0-...-d4c22b6 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

README

Go-Utilities

Some helpful functions to make go even more simpler. Updated every so often..

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BubbleSortDesc

func BubbleSortDesc(arr []string) []string

func Comma

func Comma(v int64) string

func Commaf

func Commaf(v float64) string

func ConvertToFloat

func ConvertToFloat(s string) float64

func DaysIn

func DaysIn(m time.Month, year int) int

func DenyAccess

func DenyAccess(w http.ResponseWriter, data string)

func DownloadAndSaveFile

func DownloadAndSaveFile(filepath string, url string) error

func FormatDateWithSuffix

func FormatDateWithSuffix(t time.Time) string

func FormatFloat

func FormatFloat(num float64) string

func GetDaysInMonth

func GetDaysInMonth(month string, year int) int

func GetExchangeRates

func GetExchangeRates(currency string, fallback float64) float64

func GetMonthFromName

func GetMonthFromName(month string) (t time.Month, err error)

func GetRealAddr

func GetRealAddr(r *http.Request) string

func IntArrayToString

func IntArrayToString(A []int, delim string) string

func Interface

func Interface(f interface{}) string

func JsonPrettyPrint

func JsonPrettyPrint(in string) string

func Mode

func Mode(mode []string) string

func MonthInSlice

func MonthInSlice(a interface{}, list []time.Month) bool

func OpenFile

func OpenFile(path string) (file io.ReadWriteCloser, err error)

func ParseCSVFile

func ParseCSVFile(fileName string) *os.File

func PrintEmoji

func PrintEmoji(emoji string, emojiMap map[string]string) string

func ProperlyFormatDate

func ProperlyFormatDate(date string, headerMap map[string]interface{}) (string, error)

func RedirectToHome

func RedirectToHome(w http.ResponseWriter, req *http.Request)

func RemoveDuplicates

func RemoveDuplicates(elements []string) []string

func ReverseList

func ReverseList(reversed []interface{}) []interface{}

func SendHTTPError

func SendHTTPError(reason string, rw http.ResponseWriter)

func String

func String(n int) string

func TrimCompletelyAfter

func TrimCompletelyAfter(s, remover string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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