v4

package module
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatePatternYYYYMMDD REQUIRE THEM TO DOCUMENT THIS CONST
	// 2006 = Year with four digits
	//   01 = Month with two digits
	//   02 = Day with two digits
	DatePatternYYYYMMDD = "2006-01-02"

	// DatePatternYYYYMMDDHHMMSS REQUIRE THEM TO DOCUMENT THIS CONST
	// 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 REQUIRE THEM TO DOCUMENT THIS CONST
	// 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
)

Variables

This section is empty.

Functions

func BeginningOfToday

func BeginningOfToday() time.Time

func BeginningOfTodayIn

func BeginningOfTodayIn(loc *time.Location) time.Time

func CheckFloat64JSONData

func CheckFloat64JSONData(f float64) *float64

func CheckInt64JSONData

func CheckInt64JSONData(i int64) *int64

func CheckStringJSONData

func CheckStringJSONData(s string) *string

func DSN2MAP

func DSN2MAP(dsn string) map[string]string

func DSN2Publishable

func DSN2Publishable(dsn string) string

func DiffDays

func DiffDays(date1 time.Time, date2 time.Time) (int64, error)

DiffDays REQUIRE THEM TO DOCUMENT THIS FUNCTION

func ErrorGroup

func ErrorGroup(ctx context.Context, args ...func() error) error

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

func GetByteArrayAndBufferFromRequestBody(body io.ReadCloser) ([]byte, *bytes.Buffer, error)

GetByteArrayAndBufferFromRequestBody REQUIRE THEM TO DOCUMENT THIS FUNCTION

func GetOnlyNumbers

func GetOnlyNumbers(s *string) *string

GetOnlyNumbers REQUIRE THEM TO DOCUMENT THIS FUNCTION

func GetOnlyNumbersOrSpecial

func GetOnlyNumbersOrSpecial(s *string, sp string) *string

GetOnlyNumbersOrSpecial REQUIRE THEM TO DOCUMENT THIS FUNCTION

func GetStringBodyHTTPRequest

func GetStringBodyHTTPRequest(r *http.Request) *string

GetStringBodyHTTPRequest REQUIRE THEM TO DOCUMENT THIS FUNCTION

func GetStringBodyHTTPRequestJSON

func GetStringBodyHTTPRequestJSON(r *http.Request) *string

GetStringBodyHTTPRequestJSON REQUIRE THEM TO DOCUMENT THIS FUNCTION

func GetStringBodyHTTPResponse

func GetStringBodyHTTPResponse(r *http.Response) *string

GetStringBodyHTTPResponse REQUIRE THEM TO DOCUMENT THIS FUNCTION

func GetStringBodyHTTPResponseJSON

func GetStringBodyHTTPResponseJSON(r *http.Response) *string

GetStringBodyHTTPResponseJSON REQUIRE THEM TO DOCUMENT THIS FUNCTION

func IsArray

func IsArray(arg interface{}) bool

func IsPointer

func IsPointer(arg interface{}) bool

func IsString

func IsString(arg interface{}) bool

func Join

func Join(sep string, args ...interface{}) string

func ParseBoolToString

func ParseBoolToString(b bool) string

func ParseDateStringToTime

func ParseDateStringToTime(dateString string) (*time.Time, error)

ParseDateStringToTime REQUIRE THEM TO DOCUMENT THIS FUNCTION

func ParseDateYearMonthDay

func ParseDateYearMonthDay(dateString string) (time.Time, error)

ParseDateYearMonthDay REQUIRE THEM TO DOCUMENT THIS FUNCTION

func ParseIntOrReturnZero

func ParseIntOrReturnZero(s string) int

func ParseIntToBool

func ParseIntToBool(i int) bool

func ParseStringToBool

func ParseStringToBool(s string) bool

func ParseStringToFloat64

func ParseStringToFloat64(s string) (float64, error)

ParseStringToFloat64 parse the string to float64

func ParseStringToInt

func ParseStringToInt(s string) (int, error)

func ParseStringToInt64

func ParseStringToInt64(s string) (int64, error)

func RandomInt

func RandomInt(bottom, top int) int

func RemoveNanoseconds

func RemoveNanoseconds(date time.Time) (time.Time, error)

RemoveNanoseconds REQUIRE THEM TO DOCUMENT THIS FUNCTION

func Round

func Round(value float64, precision int) float64

func StringToIntSlice

func StringToIntSlice(s string) []int

func StringToStringSlice

func StringToStringSlice(s string) []string

func ThisBytesContains

func ThisBytesContains(b []byte, s string) bool

func ToInt64Slice

func ToInt64Slice(stringSlice []string) (int64Slice []int64)

func ToIntSlice

func ToIntSlice(stringSlice []string) (intSlice []int)

func ToStringSlice

func ToStringSlice(intslice []int) (stringSlice []string)

func ToStringSlice64

func ToStringSlice64(int64Slice []int64) (stringSlice []string)

func Truncate

func Truncate(s string, i int) (r string)

Types

type Stringer

type Stringer interface {
	String() string
}

Jump to

Keyboard shortcuts

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