Documentation ¶
Overview ¶
Package utils provides a set of utility methods that can be used across the application.
Index ¶
- func DefaultBigIntString(ptr *entities.Int256) string
- func DefaultIntValue(realValue, defaultValue int) int
- func DefaultString(src string, defaultValue string) string
- func DefaultUIntDecString(ptr *entities.UInt64) string
- func MaxOf(firstValue int, secondValue int) int
- func MaxValue(realValue int, maxValue int) int
- func PtrIntDefaultValue(ptr *int, defaultValue int) int
- func PtrStringDefaultValue(ptr *string, defaultValue string) string
- func ReadAndResetCloser(reader *io.ReadCloser, pointer any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultBigIntString ¶
DefaultBigIntString returns an empty string if ptr is nil and the string value of ptr if not
func DefaultIntValue ¶
DefaultIntValue returns a default integer value if the real value equals zero
func DefaultString ¶
DefaultString returns src if it is not empty after trim (TrimSpace) or defaultValue
func DefaultUIntDecString ¶
DefaultUIntDecString returns an empty string if ptr is nil and the base 10 string representation if not
func MaxValue ¶
MaxValue returns maxValue if realValue is greater than maxValue and realValue if it is lower
func PtrIntDefaultValue ¶
PtrIntDefaultValue returns the default value if ptr is nil and the int value if not
func PtrStringDefaultValue ¶
PtrStringDefaultValue returns the default value if ptr is nil and the string value if not
func ReadAndResetCloser ¶
func ReadAndResetCloser(reader *io.ReadCloser, pointer any) error
Types ¶
This section is empty.