helpers

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(algorithm, value string) string

This function returns a hash of a given value using the specified algorithm.

The `algorithm` parameter is the algorithm to use (e.g. "MD5", "SHA-1", "SHA-256"). The `value` parameter is the string to be hashed.

Returns the hash of the value parameter using the specified algorithm.

func ParseAmount

func ParseAmount(amount float64) string

ParseAmount parses or nullifies the given amount.

The `amount` parameter represents the amount to be parsed.

Returns a string that contains the parsed `amount`.

func ToJson

func ToJson(object interface{}) (string, error)

This function serializes the object to a JSON string and returns it as a string. If an error occurs during the process, it will be returned.

func TrimValue

func TrimValue(value string) string

TrimValue trims the given value.

The `value` parameter represents the input value to be trimmed.

Returns the trimmed version of the `value`.

func ValidateZeroValue added in v1.1.0

func ValidateZeroValue(value interface{}) bool

ValidateZeroValue checks if the value is the zero value for its type.

Returns a boolean evaluation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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