utils

package
v0.0.0-...-418df79 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppExecutionPath

func AppExecutionPath() string

AppExecutionPath returns the relative path where the application is executing

func DecodeAsStringFromBase64EncodedString

func DecodeAsStringFromBase64EncodedString(msg string) (output string)

func EncodeAuthToken

func EncodeAuthToken(uid uint) (string, error)

EncodeAuthToken creates authentication token

func FmtDuration

func FmtDuration(d time.Duration) string

func FormatedDuration

func FormatedDuration(dur time.Duration) string

func GetContent

func GetContent(url string) ([]byte, error)

func GetFileExt

func GetFileExt(fileName string) string

func GetFileNameWithoutExt

func GetFileNameWithoutExt(fileName string) string

func GetFormateTime

func GetFormateTime() string

func GetStringFromGinRequestBody

func GetStringFromGinRequestBody(c *gin.Context) string

func GetValElseSetEnvFallback

func GetValElseSetEnvFallback(input string, key string) string

func GinContextFromContext

func GinContextFromContext(ctx context.Context) (*gin.Context, error)

GinContextFromContext from context

func KeyInMap

func KeyInMap(data map[string]interface{}, key string) bool

func KeyInSlice

func KeyInSlice(slice []string, val string) int

func KeyInStringMap

func KeyInStringMap(data map[string]string, key string) bool

func RenderFromTemplate

func RenderFromTemplate(filename string, data interface{}) string

RenderFromTemplate returns content

func ValInSlice

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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