common

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error)

CheckErr throws a panic for all non-nil errors passed to it.

func CountBytesInString

func CountBytesInString(str string) int

CountBytesInString takes a string and gets a byte count.

func DeserializeMap

func DeserializeMap(b []byte) (map[string]string, error)

DeserializeMap takes a byte buffer and attempts to convert it back to a map.

func Float64ToString

func Float64ToString(value *float64, places int) string

Float64ToString does conversion of floats to string values.

func GetTimestamp

func GetTimestamp() int64

GetTimestamp returns the current unix timestamp in milliseconds

func GetTimestampString

func GetTimestampString() string

GetTimestampString returns the current unix timestamp in milliseconds

func GetUUID

func GetUUID() string

GetUUID generates a Version 4 UUID string.

func Int64ToString

func Int64ToString(value *int64) string

Int64ToString converts an Integer of 64 bits to a String.

func IntArrayToString

func IntArrayToString(values []int, delimiter string) string

IntArrayToString converts an array of integers to a string delimited by a string of your choice.

func IntToString

func IntToString(value int) string

IntToString converts an Integer to a String.

func MapToJson

func MapToJson(m interface{}) string

MapToString takes a generic and converts it to a JSON representation.

func MapToQueryParams

func MapToQueryParams(m map[string]string) url.Values

MapToQueryParams takes a map of string keys and values and builds an encoded query string.

func NewFloat64

func NewFloat64(val float64) *float64

NewFloat64 returns a pointer to a float64.

func NewInt64

func NewInt64(val int64) *int64

NewInt64 returns a pointer to an int64.

func NewString

func NewString(val string) *string

NewString returns a pointer to a string.

func SerializeMap

func SerializeMap(m map[string]string) []byte

SerializeMap takes a map and attempts to convert it to a byte buffer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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