convert

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v0.0.5

func Bool(v bool) *bool

Bool returns a pointer to the bool value passed in.

func BoolMap added in v0.0.5

func BoolMap(src map[string]bool) map[string]*bool

BoolMap converts a string map of bool values into a string map of bool pointers

func BoolSlice added in v0.0.5

func BoolSlice(src []bool) []*bool

BoolSlice converts a slice of bool values into a slice of bool pointers

func BoolValue added in v0.0.5

func BoolValue(v *bool) bool

BoolValue returns the value of the bool pointer passed in or false if the pointer is nil.

func BoolValueMap added in v0.0.5

func BoolValueMap(src map[string]*bool) map[string]bool

BoolValueMap converts a string map of bool pointers into a string map of bool values

func BoolValueSlice added in v0.0.5

func BoolValueSlice(src []*bool) []bool

BoolValueSlice converts a slice of bool pointers into a slice of bool values

func ByteToFloat64 added in v0.1.0

func ByteToFloat64(bytes []byte) float64

ByteToFloat64 convert byte to float64

func Float64 added in v0.0.5

func Float64(v float64) *float64

Float64 returns a pointer to the float64 value passed in.

func Float64Map added in v0.0.5

func Float64Map(src map[string]float64) map[string]*float64

Float64Map converts a string map of float64 values into a string map of float64 pointers

func Float64Slice added in v0.0.5

func Float64Slice(src []float64) []*float64

Float64Slice converts a slice of float64 values into a slice of float64 pointers

func Float64ToByte added in v0.1.0

func Float64ToByte(f float64) []byte

Float64ToByte convert float64 to byte ref: https://stackoverflow.com/questions/43693360/convert-float64-to-byte-array

func Float64Value added in v0.0.5

func Float64Value(v *float64) float64

Float64Value returns the value of the float64 pointer passed in or 0 if the pointer is nil.

func Float64ValueMap added in v0.0.5

func Float64ValueMap(src map[string]*float64) map[string]float64

Float64ValueMap converts a string map of float64 pointers into a string map of float64 values

func Float64ValueSlice added in v0.0.5

func Float64ValueSlice(src []*float64) []float64

Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values

func Int added in v0.0.4

func Int(v int) *int

Int returns a pointer to the int value passed in.

func Int64 added in v0.0.6

func Int64(v int64) *int64

Int64 returns a pointer to the int64 value passed in.

func Int64Map added in v0.0.6

func Int64Map(src map[string]int64) map[string]*int64

Int64Map converts a string map of int64 values into a string map of int64 pointers

func Int64Slice added in v0.0.6

func Int64Slice(src []int64) []*int64

Int64Slice converts a slice of int64 values into a slice of int64 pointers

func Int64Value added in v0.0.6

func Int64Value(v *int64) int64

Int64Value returns the value of the int64 pointer passed in or 0 if the pointer is nil.

func Int64ValueMap added in v0.0.6

func Int64ValueMap(src map[string]*int64) map[string]int64

Int64ValueMap converts a string map of int64 pointers into a string map of int64 values

func Int64ValueSlice added in v0.0.6

func Int64ValueSlice(src []*int64) []int64

Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values

func IntMap added in v0.0.5

func IntMap(src map[string]int) map[string]*int

IntMap converts a string map of int values into a string map of int pointers

func IntSlice added in v0.0.5

func IntSlice(src []int) []*int

IntSlice converts a slice of int values into a slice of int pointers

func IntValue added in v0.0.4

func IntValue(v *int) int

IntValue returns the value of the string pointer passed in or "" if the pointer is nil.

func IntValueMap added in v0.0.5

func IntValueMap(src map[string]*int) map[string]int

IntValueMap converts a string map of int pointers into a string map of int values

func IntValueSlice added in v0.0.5

func IntValueSlice(src []*int) []int

IntValueSlice converts a slice of int pointers into a slice of int values

func MD5Hash added in v0.0.3

func MD5Hash(text string) string

MD5Hash for md5 hash string

func SnakeCasedName added in v0.0.9

func SnakeCasedName(name string) string

SnakeCasedName convert String into Snake Case ex: FooBar -> foo_bar

func String added in v0.0.3

func String(v string) *string

String returns a pointer to the string value passed in.

func StringMap added in v0.0.5

func StringMap(src map[string]string) map[string]*string

StringMap converts a string map of string values into a string map of string pointers

func StringSlice added in v0.0.5

func StringSlice(src []string) []*string

StringSlice converts a slice of string values into a slice of string pointers

func StringValue added in v0.0.3

func StringValue(v *string) string

StringValue returns the value of the string pointer passed in or "" if the pointer is nil.

func StringValueMap added in v0.0.5

func StringValueMap(src map[string]*string) map[string]string

StringValueMap converts a string map of string pointers into a string map of string values

func StringValueSlice added in v0.0.5

func StringValueSlice(src []*string) []string

StringValueSlice converts a slice of string pointers into a slice of string values

func TitleCasedName added in v0.0.9

func TitleCasedName(name string) string

TitleCasedName convert String into title cased ex: foo_bar -> FooBar

func ToBool

func ToBool(value interface{}) bool

ToBool convert any type to boolean

func ToFloat

func ToFloat(value interface{}) interface{}

ToFloat convert any type to float

func ToInt

func ToInt(value interface{}) interface{}

ToInt convert any type to int

func ToString

func ToString(value interface{}) string

ToString convert any type to string

Types

This section is empty.

Jump to

Keyboard shortcuts

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