helpers

package
v0.0.0-...-9859e96 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capitalize

func Capitalize(str string) string

func DecimalAdjust

func DecimalAdjust(value float64, exp int) float64

func DownloadCSVFileFromAWS

func DownloadCSVFileFromAWS(env *config.AWSConfig, file string) ([][]string, error)

func FormatMoney

func FormatMoney(value float64, precision int) string

func GetFileFromAWS

func GetFileFromAWS(env *config.AWSConfig, file string) ([]byte, error)

func GetFilePrefix

func GetFilePrefix() string

func Int32ToString

func Int32ToString(i int32) string

func IsValidUserId

func IsValidUserId(userId string) bool

func ObjectToJsonString

func ObjectToJsonString(obj interface{}) string

func ReadCSVFile

func ReadCSVFile(filePath string) ([][]string, error)

func ReadFile

func ReadFile(filePath string) ([]byte, error)

func ReadJsonFile

func ReadJsonFile(filePath string, obj interface{}) error

func Round

func Round(value float64, precision int) float64

func ServeHandlerFunc

func ServeHandlerFunc(handlerFunc http.HandlerFunc, req *http.Request) (*httptest.ResponseRecorder, error)

func SortByDate

func SortByDate(data [][]string, by string) [][]string

func StringToBool

func StringToBool(str string) bool

func StringToDate

func StringToDate(str string) time.Time

func StringToFloat64

func StringToFloat64(str string) float64

func StringToInt32

func StringToInt32(str string) int32

func StringToInt64

func StringToInt64(str string) int64

func StringToTime

func StringToTime(str string) time.Time

func StringToTimeWithFormat

func StringToTimeWithFormat(str string, format string) time.Time

func StringToTimeWithLocation

func StringToTimeWithLocation(str string, location *time.Location) time.Time

func TimeToString

func TimeToString(t time.Time) string

func TimeToStringWithFormat

func TimeToStringWithFormat(t time.Time, format string) string

func TimeToStringWithLocation

func TimeToStringWithLocation(t time.Time, location *time.Location) string

func TimeToTimestamp

func TimeToTimestamp(t time.Time) *timestamp.Timestamp

func TimestampToString

func TimestampToString(ts *timestamp.Timestamp) string

func TimestampToStringWithFormat

func TimestampToStringWithFormat(ts *timestamp.Timestamp, format string) string

func TimestampToStringWithLocation

func TimestampToStringWithLocation(ts *timestamp.Timestamp, location *time.Location) string

func TimestampToTime

func TimestampToTime(ts *timestamp.Timestamp) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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