Documentation ¶
Index ¶
- Constants
- Variables
- func BeginningOfToday() time.Time
- func BeginningOfTodayIn(loc *time.Location) time.Time
- func CheckFloat64JSONData(f float64) *float64
- func CheckInt64JSONData(i int64) *int64
- func CheckStringJSONData(s string) *string
- func DSN2MAP(dsn string) map[string]string
- func DSN2Publishable(dsn string) string
- func DiffDays(date1 time.Time, date2 time.Time) (int64, error)
- func ErrorGroup(ctx context.Context, args ...func() error) error
- func Fill(dest interface{}, src interface{})
- func GetByteArrayAndBufferFromRequestBody(body io.ReadCloser) ([]byte, *bytes.Buffer, error)
- func GetOnlyNumbers(s *string) *string
- func GetOnlyNumbersOrSpecial(s *string, sp string) *string
- func GetStringBodyHTTPRequest(r *http.Request) *string
- func GetStringBodyHTTPRequestJSON(r *http.Request) *string
- func GetStringBodyHTTPResponse(r *http.Response) *string
- func GetStringBodyHTTPResponseJSON(r *http.Response) *string
- func IsArray(arg interface{}) bool
- func IsPointer(arg interface{}) bool
- func IsString(arg interface{}) bool
- func Join(sep string, args ...interface{}) string
- func ParseBoolToString(b bool) string
- func ParseDateStringToTime(dateString string) (*time.Time, error)
- func ParseDateYearMonthDay(dateString string) (time.Time, error)
- func ParseIntOrReturnZero(s string) int
- func ParseIntToBool(i int) bool
- func ParseStringToBool(s string) bool
- func ParseStringToFloat64(s string) (float64, error)
- func ParseStringToInt(s string) (int, error)
- func ParseStringToInt64(s string) (int64, error)
- func RandomInt(bottom, top int) int
- func RemoveNanoseconds(date time.Time) (time.Time, error)
- func Round(value float64, precision int) float64
- func StringToIntSlice(s string) []int
- func StringToStringSlice(s string) []string
- func ToInt64Slice(stringSlice []string) (int64Slice []int64)
- func ToIntSlice(stringSlice []string) (intSlice []int)
- func ToStringSlice(intslice []int) (stringSlice []string)
- func ToStringSlice64(int64Slice []int64) (stringSlice []string)
- func Truncate(s string, i int) (r string)
- type Stringer
Constants ¶
const ( // HTTPStatusUnprocessableEntity Deprecated: use http.StatusUnprocessableEntity instead HTTPStatusUnprocessableEntity = 422 // DatePatternYYYYMMDD // 2006 = Year with four digits // 01 = Month with two digits // 02 = Day with two digits DatePatternYYYYMMDD = "2006-01-02" // DatePatternYYYYMMDDHHMMSS // 2006 = Year with four digits // 01 = Month with two digits // 02 = Day with two digits // 15 = Hour with two digits (24h) // 04 = Minute with two digits // 05 = Seconds with two digits DatePatternYYYYMMDDHHMMSS = "2006-01-02 15:04:05" // DatePatternYYYYMMDDTHHMMSS // 2006 = Year with four digits // 01 = Month with two digits // 02 = Day with two digits // 15 = Hour with two digits (24h) // 04 = Minute with two digits // 05 = Seconds with two digits DatePatternYYYYMMDDTHHMMSS = "2006-01-02T15:04:05" DatePatternYYYYMMDDTHHMMSSZ = time.RFC3339 // NOTE: backward compatibility )
Variables ¶
var ( RFC3339NanoWithoutTAndTimezone string = strings.ReplaceAll( strings.ReplaceAll(time.RFC3339Nano, `T`, ` `), `Z07:00`, ``) )
Functions ¶
func BeginningOfToday ¶
BeginningOfToday REQUIRE THEM TO DOCUMENT THIS FUNCTION
func BeginningOfTodayIn ¶
BeginningOfTodayIn REQUIRE THEM TO DOCUMENT THIS FUNCTION
func CheckFloat64JSONData ¶
CheckFloat64JSONData REQUIRE THEM TO DOCUMENT THIS FUNCTION
func CheckInt64JSONData ¶
CheckInt64JSONData REQUIRE THEM TO DOCUMENT THIS FUNCTION
func CheckStringJSONData ¶
CheckStringJSONData REQUIRE THEM TO DOCUMENT THIS FUNCTION
func DSN2Publishable ¶
DSN2Publishable REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ErrorGroup ¶
ErrorGroup resolves all go routines. It fails at first error encountered warning: Creating goroutines in the args will cause them to run in background
func Fill ¶
func Fill(dest interface{}, src interface{})
Fill merges data from struct instance to another By @titpetric suggested in https://scene-si.org/2016/06/01/golang-tips-and-tricks
func GetByteArrayAndBufferFromRequestBody ¶
GetByteArrayAndBufferFromRequestBody REQUIRE THEM TO DOCUMENT THIS FUNCTION
func GetOnlyNumbers ¶
GetOnlyNumbers REQUIRE THEM TO DOCUMENT THIS FUNCTION
func GetOnlyNumbersOrSpecial ¶
GetOnlyNumbersOrSpecial REQUIRE THEM TO DOCUMENT THIS FUNCTION
func GetStringBodyHTTPRequest ¶
GetStringBodyHTTPRequest REQUIRE THEM TO DOCUMENT THIS FUNCTION
func GetStringBodyHTTPRequestJSON ¶
GetStringBodyHTTPRequestJSON REQUIRE THEM TO DOCUMENT THIS FUNCTION
func GetStringBodyHTTPResponse ¶
GetStringBodyHTTPResponse REQUIRE THEM TO DOCUMENT THIS FUNCTION
func GetStringBodyHTTPResponseJSON ¶
GetStringBodyHTTPResponseJSON REQUIRE THEM TO DOCUMENT THIS FUNCTION
func IsPointer ¶
func IsPointer(arg interface{}) bool
IsPointer REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseBoolToString ¶
ParseBoolToString REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseDateStringToTime ¶
ParseDateStringToTime REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseDateYearMonthDay ¶
ParseDateYearMonthDay REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseIntOrReturnZero ¶
ParseIntOrReturnZero REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseIntToBool ¶
ParseIntToBool REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseStringToBool ¶
ParseStringToBool REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseStringToFloat64 ¶
ParseStringToFloat64 parse the string to float64
func ParseStringToInt ¶
ParseStringToInt REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ParseStringToInt64 ¶
ParseStringToInt64 REQUIRE THEM TO DOCUMENT THIS FUNCTION
func RemoveNanoseconds ¶
RemoveNanoseconds REQUIRE THEM TO DOCUMENT THIS FUNCTION
func StringToIntSlice ¶
StringToIntSlice REQUIRE THEM TO DOCUMENT THIS FUNCTION
func StringToStringSlice ¶
StringToStringSlice REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ToInt64Slice ¶
ToInt64Slice REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ToIntSlice ¶
ToIntSlice REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ToStringSlice ¶
ToStringSlice REQUIRE THEM TO DOCUMENT THIS FUNCTION
func ToStringSlice64 ¶
ToStringSlice64 REQUIRE THEM TO DOCUMENT THIS FUNCTION