Categorygithub.com/tech4works/converter
modulepackage
0.0.0-20240813212833-e25e14cbad01
Repository: https://github.com/tech4works/converter.git
Documentation: pkg.go.dev

# README

converter

# Functions

CouldBeBase64 checks if a given value can be decoded from a base64 string without causing an error.
CouldBeBool checks if an arbitrary value can be converted to a boolean value.
CouldBeBytes checks whether a given value could be converted to bytes.
CouldBeComplex determines if the provided parameter can be converted to a complex128 value without producing an error.
CouldBeFloat determines whether a given value can be converted to a float64.
CouldBeInt attempts to convert a given value to an integer representation.
CouldBeString inspects if a given value could be converted to a string representation with an error.
CouldBeUint checks if the value of any type can be converted to a uint without errors.
FromBase64 decodes a base64-encoded string.
FromBase64ToString decodes a base64-encoded value to a string.
FromBase64ToStringWithErr decodes a base64-encoded value into a string.
FromBase64WithErr attempts to decode a base64-encoded string from any possible types of inputs.
ToBase64 attempts to convert a given value to a base64 string representation.
ToBase64WithErr converts a given value to a base64 string representation.
ToBool converts an arbitrary type to a boolean value.
ToBoolWithErr converts an arbitrary type to a boolean value.
ToBuffer attempts to convert a given value into a buffer.
ToBufferWithErr attempts to convert a given value to a bytes.Buffer It first tries to convert the supplied argument to a byte slice by calling the function ToBytesWithErr.
ToBytes converts any given value to bytes.
ToBytesWithErr attempts to convert a given value to a byte slice representation based on its type.
ToCompactString converts a given value to a string representation in a compact form.
ToCompactStringWithErr converts a given value to a string representation in a compact form, where all white spaces are replaced by single spaces.
ToComplex128 attempts to convert a given value to a complex128 value based on its type.
ToComplex128WithErr tries to convert a given value to a complex128 value based on its type.
ToComplex64 tries to convert a given value to a complex64 value based on its type.
ToComplex64WithErr tries to convert a given value to a complex64 value based on its type.
ToDest converts value 'a' into destination 'dest', returning an error if conversion is not successful.
ToDestWithErr attempts to convert a given value to a specified destination type.
ToFloat32 attempts to convert a given value of any type to a float32 value.
ToFloat32WithErr attempts to convert the given value of any type to a float32 value.
ToFloat64 attempts to convert a value of any type to a float64 value.
ToFloat64WithErr attempts to convert the given value of any type to a float64 value.
ToInt converts a value of any type to an integer form.
ToInt16 converts a given value to an int16 type.
ToInt16WithErr attempts to convert a given value to a int16 representation and returns an error if unsuccessful.
ToInt32 converts a given value to an integer of type int32.
ToInt32WithErr attempts to convert a given value into an int32 representation and returns an error if unsuccessful.
ToInt64 attempts to convert a given value to a 64-bit integer representation.
ToInt64WithErr attempts to convert a given value to a 64-bit integer.
ToInt8 attempts to convert a given value to an int8 representation.
ToInt8WithErr tries to convert a value of any type to int8.
ToIntWithErr attempts to convert a given value to an integer representation and returns an error if unsuccessful.
ToPointer creates a pointer to the given value.
ToString attempts to convert any given input value to a string representation.
ToStringWithErr converts a given value to a string representation based on its type.
ToUint converts any given value to an uint type.
ToUint16 attempts to convert any given value to an uint16 type.
ToUint16WithErr attempts to convert any given value to an uint16 type.
ToUint32 attempts to convert any given value to an uint32 type.
ToUint32WithErr attempts to convert any given value to a uint32 type.
ToUint64 receives a value of any type and attempts to convert it to an uint64 type.
ToUint64WithErr attempts to convert any given value to an uint64 type.
ToUint8 attempts to convert any given value to an uint8 type.
ToUint8WithErr attempts to convert a given value to uint8 type.
ToUintWithErr attempts to convert any given value to an uint type.