Documentation ¶
Index ¶
- Constants
- 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 ParseDateStringToTimeIn(dateString string, loc *time.Location) (*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 ThisBytesContains(b []byte, s string) bool
- 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 Copier
- type Stringer
Constants ¶
View Source
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" // DatePatternYYYYMMDDTHHMMSS // ISO 8601 format with timezone offset // 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 // 07 = Timezone offset hours with two digits // 00 = Timezone offset minutes with two digits DatePatternYYYYMMDDTHHMMSSOffset = "2006-01-02T15:04:05-07:00" DatePatternYYYYMMDDTHHMMSSZ = time.RFC3339 // NOTE: backward compatibility )
Variables ¶
This section is empty.
Functions ¶
func CheckFloat64JSONData ¶
func CheckInt64JSONData ¶
func CheckStringJSONData ¶
func DSN2Publishable ¶
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
func GetOnlyNumbersOrSpecial ¶
GetOnlyNumbersOrSpecial
func GetStringBodyHTTPRequest ¶
GetStringBodyHTTPRequest
func GetStringBodyHTTPRequestJSON ¶
GetStringBodyHTTPRequestJSON
func GetStringBodyHTTPResponse ¶
GetStringBodyHTTPResponse
func GetStringBodyHTTPResponseJSON ¶
GetStringBodyHTTPResponseJSON
func ParseBoolToString ¶
func ParseDateStringToTime ¶
ParseDateStringToTime
func ParseDateStringToTimeIn ¶ added in v4.2.0
ParseDateStringToTimeIn parses a date string into time type in a specific location
func ParseDateYearMonthDay ¶
ParseDateYearMonthDay
func ParseIntOrReturnZero ¶
func ParseIntToBool ¶
func ParseStringToBool ¶
func ParseStringToFloat64 ¶
ParseStringToFloat64 parse the string to float64
func ParseStringToInt ¶
func ParseStringToInt64 ¶
func RemoveNanoseconds ¶
RemoveNanoseconds
func StringToIntSlice ¶
func StringToStringSlice ¶
func ThisBytesContains ¶
func ToInt64Slice ¶
func ToIntSlice ¶
func ToStringSlice ¶
func ToStringSlice64 ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.