util

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(v bool) *bool

BoolPtr ...

func ByteSlicePtr

func ByteSlicePtr(v []byte) *[]byte

ByteSlicePtr ...

func Float32Ptr

func Float32Ptr(v float32) *float32

Float32Ptr ...

func Float64Ptr

func Float64Ptr(v float64) *float64

Float64Ptr ...

func Int32Ptr

func Int32Ptr(v int32) *int32

Int32Ptr ...

func Int64Ptr

func Int64Ptr(v int64) *int64

Int64Ptr ...

func IntPtr

func IntPtr(v int) *int

IntPtr ...

func IsSafeKey

func IsSafeKey(s string) (bool, string)

IsSafeKey return if the key is safe to store

func IsSafeValue

func IsSafeValue(s string) (bool, string)

IsSafeValue return if the value is safe to store

func NewSecureRandomKey

func NewSecureRandomKey() string

NewSecureRandomKey creates a new secure random key

func Round

func Round(f float64) int

Round makes the float to int conversion with rounding

func SafeString

func SafeString(s interface{}) (ret string)

SafeString safely cast to string

func SafeStringWithDefault

func SafeStringWithDefault(s interface{}, deft string) (ret string)

SafeStringWithDefault parse an interface to string and set it to default value if it's empty

func SafeUint

func SafeUint(s interface{}) (ret uint)

SafeUint returns the uint of the value

func StringPtr

func StringPtr(v string) *string

StringPtr ...

func TimeNow

func TimeNow() string

TimeNow follows RFC3339 time format

func Uint32Ptr

func Uint32Ptr(v uint32) *uint32

Uint32Ptr ...

func Uint64Ptr

func Uint64Ptr(v uint64) *uint64

Uint64Ptr ...

func UintPtr

func UintPtr(v uint) *uint

UintPtr ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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