Documentation ¶
Index ¶
- func FromHttpResponse(res *http.Response, v any) error
- func ParseDuration(value string) (time.Duration, error)
- func ToJsonArray(value any) ([]any, error)
- func ToMap(value any) (map[string]any, error)
- func ToStringWithDefault(value any, defaultValue string) string
- func ToValueWithDefault[T any](ptr *T, defaultValue T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromHttpResponse ¶
FromHttpResponse reads the response body from the specified http response and converts it into the specified value
func ToJsonArray ¶
ToJsonArray converts the specified value (slice) to a json array
func ToStringWithDefault ¶
Attempts to convert the specified value to a string, otherwise returns the default value
func ToValueWithDefault ¶
func ToValueWithDefault[T any](ptr *T, defaultValue T) T
Converts a pointer to a value type If the ptr is nil returns default value, otherwise the value of value of the pointer
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.