utils

package module
v0.0.0-...-0d928f5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

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 Bod

func Bod(t time.Time) time.Time

func BubbleSortDesc

func BubbleSortDesc(arr []string) []string

func CheckDBErr

func CheckDBErr(err error, db string)

func Comma

func Comma(v int64) string

func Commaf

func Commaf(v float64) string

func ConvertToFloat

func ConvertToFloat(s string) float64

func CurrencySymbol

func CurrencySymbol(country, currency string) string

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 Eod

func Eod(t time.Time) time.Time

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 GetExchangeRateFor

func GetExchangeRateFor(currency string, toCurrency string, apiKey string) float64

func GetExchangeRates

func GetExchangeRates(currency string, fallback float64, apiKey string) float64

func GetMonthFromName

func GetMonthFromName(month string) time.Month

func GetRealAddr

func GetRealAddr(r *http.Request) string

func GetRoad

func GetRoad(lat, long, apiKey string) 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 StringInSlice

func StringInSlice(a string, list []string) bool

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