Documentation ¶
Index ¶
- Constants
- func AddExtraSpaceIfExist(str string) string
- func CheckFileIsExist(filename string) bool
- func DeleteExtraSpace(s string) string
- func GRPCErrIsUnknownWrapper(err error) error
- func GenerateSnowFlakeID(nodenumber int64) int64
- func GetCurrentTime() time.Time
- func GetCurrentTimeString(timeType string) string
- func GetCurrentTimeUnix() int64
- func GetFreePort() (int, error)
- func GetServiceID(projectName string, projectVersion string, ServiceIP string, ServicePort int) string
- func GetServiceName(projectName string) string
- func GetTypeName(myvar interface{}, isToLowerCase bool) string
- func Getparentdirectory(path string, level int) string
- func HTTPErrDecoder(err error) (bool, map[string]string)
- func HTTPErrEncoder(err error) error
- func RecordErrorLevelTwo() (uintptr, string, int)
- func SliceInSlice(sliceToCheck []string, slice []string) bool
- func StringInSlice(value string, stringSlice []string) bool
- type RandomGenerater
- type ValueStrategy
- type ValueValidationImpl
Constants ¶
const RFC3339FullDate = "2006-01-02"
RFC3339FullDate for rfc full date
Variables ¶
This section is empty.
Functions ¶
func AddExtraSpaceIfExist ¶
AddExtraSpaceIfExist adds a separator
func CheckFileIsExist ¶
CheckFileIsExist : check file if exist ,exist -> true , not exist -> false , *
- @param filename string ,the file name need to check
- @return boolean string
func GRPCErrIsUnknownWrapper ¶
GRPCErrIsUnknownWrapper unknown err wrapper only will wrapper the error which is not be encoded P.S :this wrapper is used in grpc
func GenerateSnowFlakeID ¶
GenerateSnowFlakeID generate snowflake id
func GetCurrentTimeString ¶
GetCurrentTimeString get current time with string
func GetCurrentTimeUnix ¶
func GetCurrentTimeUnix() int64
GetCurrentTimeUnix get current time with unix time
func GetServiceID ¶
func GetServiceID(projectName string, projectVersion string, ServiceIP string, ServicePort int) string
GetServiceID get service name which will register to service mesh
func GetServiceName ¶
GetServiceName get service name which will register to service mesh
func GetTypeName ¶
GetTypeName to get struct type name
func Getparentdirectory ¶
Getparentdirectory : get parent directory of the path ,
- @param path string ,the path you want to get parent directory
- @return string , the parent directory you need
func HTTPErrDecoder ¶
HTTPErrDecoder decode
func HTTPErrEncoder ¶
HTTPErrEncoder encode http err only will wrapper the error which is not be encoded P.S :this wrapper is used in grpc
func RecordErrorLevelTwo ¶
RecordErrorLevelTwo login error and print line , func , and error to gin context
func SliceInSlice ¶
SliceInSlice if slice in slice
func StringInSlice ¶
StringInSlice if value in stringlist
Types ¶
type RandomGenerater ¶ added in v0.0.50
type RandomGenerater interface {
RandomString() string
}
RandomGenerater random generater interface{}
func NewRandomGenerater ¶ added in v0.0.50
func NewRandomGenerater(r *rand.Rand, len int) RandomGenerater
NewRandomGenerater new generater
type ValueStrategy ¶ added in v0.0.37
ValueStrategy interface
type ValueValidationImpl ¶ added in v0.0.37
type ValueValidationImpl struct {
// contains filtered or unexported fields
}
ValueValidationImpl value validation imple
func (*ValueValidationImpl) IfHasNilValue ¶ added in v0.0.37
func (v *ValueValidationImpl) IfHasNilValue() bool
IfHasNilValue check all args if has value , if all has value , return true , elase return flase
func (*ValueValidationImpl) Load ¶ added in v0.0.37
func (v *ValueValidationImpl) Load(args ...interface{})
Load load args
func (*ValueValidationImpl) ZeroIndex ¶ added in v0.0.37
func (v *ValueValidationImpl) ZeroIndex() int
ZeroIndex return first zero index