utilities

package
v0.0.0-...-eacaa5b Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeB64

func EncodeB64(s string) string

func GetBearerToken

func GetBearerToken(authHeader string) (token string)

func GetExtensionFromContentType

func GetExtensionFromContentType(mime string) string

func GetFormErrorsJsonStringBodyReturn

func GetFormErrorsJsonStringBodyReturn(success bool, messageKey string, formErrors map[string]interface{}) string

func GetJsonStringBodyReturn

func GetJsonStringBodyReturn(success bool, data map[string]interface{}) string

func GetRandomString

func GetRandomString(n int, prefix string) string

via mailgun vendor randomString generates a string of given length, but random content. All content will be within the ASCII graphic character set. (Implementation from Even Shaw's contribution on http://stackoverflow.com/questions/12771930/what-is-the-fastest-way-to-generate-a-long-random-string-in-go).

func GetSimpleJsonStringBodyReturn

func GetSimpleJsonStringBodyReturn(success bool, messageKey string, messageParameters map[string]string) string

func GetWeirdString

func GetWeirdString() string

func Implode

func Implode(mapStrStr map[string]string, del string) string

func InArrayStr

func InArrayStr(val string, array []string) (exists bool, index int)

func MaskString

func MaskString(s string, masker string) string

func PrintMilestone

func PrintMilestone(mapStore map[string]interface{}, s string)

func ProcessTemplate

func ProcessTemplate(messageParameters map[string]string, emailText string, emailHTML string, subject string) (string, string, string)

func SanitizeFilename

func SanitizeFilename(s string) string

func SendEmailSmtp

func SendEmailSmtp(from string, password string, to string, subject string, body string, smtpServer string, smtpPort int) error

func SubStr

func SubStr(str string, start int, length int) string

func TimeDiff

func TimeDiff(a, b time.Time) (year, month, day, hour, min, sec int)

thanks http://stackoverflow.com/questions/36530251/golang-time-since-with-months-and-years

func UcWords

func UcWords(str 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