convert

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(condition bool) *bool

BoolPtr takes in boolean condition and returns pointer version of it

func FloatFromString

func FloatFromString(raw interface{}) (float64, error)

FloatFromString converts a string to a float64. Will return error if unable to convert.

func Int64FromString

func Int64FromString(raw interface{}) (int64, error)

Int64FromString converts a string to an int64. Will return error if unable to convert.

func IntFromString

func IntFromString(raw interface{}) (int, error)

IntFromString converts a string to an int. Will return error if unable to convert.

func RoundDuration

func RoundDuration(d time.Duration, digits int) time.Duration

RoundDuration takes in a time.Duration, and rounds to the wanted digits

func TimeFromUnixTimestampDecimal

func TimeFromUnixTimestampDecimal(input float64) time.Time

TimeFromUnixTimestampDecimal converts a unix timestamp in decimal form to a time.Time struct.

func TimeFromUnixTimestampFloat

func TimeFromUnixTimestampFloat(raw interface{}) (time.Time, error)

TimeFromUnixTimestampFloat converts a unix timestamp in float form to // a time.Time struct. Will return error if unable to convert.

func UnixTimestampStrToTime

func UnixTimestampStrToTime(timeStr string) (time.Time, error)

UnixTimestampStrToTime converts a unix timestamp in str format to a time.Timestruct. Will return error if unable to convert.

func UnixTimestampToTime

func UnixTimestampToTime(timeint64 int64) time.Time

UnixTimestampToTime converts a unix timestamp to a time.Time struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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