Documentation
¶
Index ¶
- Constants
- func Came2KebabCase(name string) string
- func Camel2Case(name string) string
- func Case2Camel(name string) string
- func Contains[T comparable](sources []T, target T) bool
- func ContainsArray[T comparable](sources []T, targets ...T) bool
- func Difference[T comparable](a1, a2 []T) []T
- func GetAgeString(t time.Time) string
- func GetEnvOrIniValue(iniFile *ini.File, section string, key string) string
- func GetFileNameByTempFile(username, tempFileName string) string
- func GetFileTypeByFileName(filename string) string
- func GetFormFile(c *models.ReqContext, key string) ([]byte, error)
- func GetMonthsFromTimeRange(timeFrom, timeTo time.Time) ([]string, error)
- func GetTempFileName(username, filename string) string
- func GetTimeLocation(location string) (*time.Location, error)
- func Intersection[T comparable](a1, a2 []T) []T
- func Lcfirst(str string) string
- func SetDefaultBool(targetstr string, defaultVal bool) bool
- func SetDefaultDuration(targetstr string, defaultVal ...time.Duration) time.Duration
- func SetDefaultFloat64(targetstr string, defaultVal ...float64) float64
- func SetDefaultInt(targetstr string, defaultVal int) int
- func SetDefaultInt64(targetstr string, defaultVal int64) int64
- func SetDefaultString(targetstr string, defaultVal string) string
- func SplitString(str string) []string
- func StrToBoolean(value string) bool
- func StringsFallback2(val1 string, val2 string) string
- func StringsFallback3(val1 string, val2 string, val3 string) string
- func SubMonth(later, earlier time.Time) (month int)
- func Ucfirst(str string) string
- func Union[T comparable](a1, a2 []T) []T
- func ValidateEmail(email string) bool
- type Buffer
- type NetworkAddress
Constants ¶
View Source
const ( Month_TIME_LAYOUT = "2006-01" DEFAULT_TIME_LAYOUT = "2006-01-02" DEFAULT_DB_TIME_LAYOUT = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func Came2KebabCase ¶
func Camel2Case ¶
func Case2Camel ¶
func Contains ¶
func Contains[T comparable](sources []T, target T) bool
判断元素target是否在sources中存在,存在返回true, 反之返回false
func ContainsArray ¶
func ContainsArray[T comparable](sources []T, targets ...T) bool
判断数组元素targets是否都在sources中存在,全部存在返回true, 反之返回false
func GetAgeString ¶
func GetFileNameByTempFile ¶
func GetFileTypeByFileName ¶
func GetFormFile ¶
func GetFormFile(c *models.ReqContext, key string) ([]byte, error)
func GetMonthsFromTimeRange ¶
func GetTempFileName ¶
func SetDefaultBool ¶
func SetDefaultDuration ¶
func SetDefaultFloat64 ¶
func SetDefaultInt ¶
func SetDefaultInt64 ¶
func SetDefaultString ¶
func SplitString ¶
func StrToBoolean ¶
func StringsFallback2 ¶
func ValidateEmail ¶
Types ¶
type NetworkAddress ¶
func SplitHostPort ¶
func SplitHostPort(input string) (NetworkAddress, error)
SplitHostPort splits ip address/hostname string by host and port
func SplitHostPortDefault ¶
func SplitHostPortDefault(input, defaultHost, defaultPort string) (NetworkAddress, error)
SplitHostPortDefault splits ip address/hostname string by host and port. Defaults used if no match found
Click to show internal directories.
Click to hide internal directories.