Documentation
¶
Index ¶
- Constants
- func AcceptMimeType(mimeType string, accept string) bool
- func CheckCertWithDomain(cert *x509.Certificate, domain string) bool
- func CheckCertWithTime(cert *x509.Certificate, gracePeriod time.Duration) bool
- func CheckIfSubPath(parentPath, childPath string) bool
- func CheckIfSubPathNotEqual(parentPath, childPath string) bool
- func CleanFilePathAbs(pathstr string) (string, error)
- func CountSpaceInStringPrefix(str string) int
- func EncodePrivateKeyToPEM(privateKey crypto.PrivateKey) ([]byte, error)
- func ErrorExit(msg string, code ...int) int
- func Exit(code ...int) int
- func ExitByError(err error, code ...int) int
- func ExitByErrorMsg(msg string, code ...int) int
- func FilePathEqual(path1, path2 string) bool
- func FormatTextToWidth(text string, width int) string
- func FormatTextToWidthAndPrefix(text string, prefixWidth int, overallWidth int) string
- func GetArgs0() string
- func GetArgs0Name() string
- func GetCallingFunctionInfo(skip int) (string, string, string, int)
- func GetGoVersion() (int64, int64, int64, error)
- func GetGoVersionMajor() (int64, error)
- func GetGoVersionMajorMust() int64
- func GetGoVersionMinor() (int64, error)
- func GetGoVersionMinorMust() int64
- func GetGoVersionPatch() (int64, error)
- func GetGoVersionPatchMust() int64
- func HasFieldByReflect(typ reflect.Type, fieldName string) bool
- func InvalidPhone(phone string) bool
- func IsDir(path string) bool
- func IsExists(path string) bool
- func IsFile(path string) bool
- func IsGoodQueryKey(key string) bool
- func IsValidDomain(domain string) bool
- func IsValidEmail(email string) bool
- func IsValidHTTPHeaderKey(key string) bool
- func IsValidIPv4CIDR(cidr string) bool
- func IsValidIPv6CIDR(cidr string) bool
- func IsValidURLPath(path string) bool
- func ProcessURLPath(path string, defaultUrl ...string) string
- func Rand() *rand.Rand
- func RandStr(length int) string
- func ReadCertificate(data []byte) (*x509.Certificate, error)
- func ReadPrivateKey(data []byte) (crypto.PrivateKey, error)
- func SayGoodByef(format string, args ...interface{})
- func SayHellof(format string, args ...interface{})
- func SplitHostPort(hostPort string) (host, port string)
- func StringToOnlyPrint(str string) string
- func URLClone(old *url.URL) *url.URL
- func ValidIPv4(ipString string) bool
- func ValidIPv6(ipString string) bool
- type StringBool
- func (s *StringBool) IsDisable(defaultVal ...bool) (res bool)
- func (s *StringBool) IsEnable(defaultVal ...bool) (res bool)
- func (s *StringBool) SetDefaultDisable()
- func (s *StringBool) SetDefaultEnable()
- func (s *StringBool) ToBool(defaultVal ...bool) bool
- func (s *StringBool) ToString() string
- func (s *StringBool) ToStringDefaultDisable() string
- func (s *StringBool) ToStringDefaultEnable() string
Constants ¶
View Source
const BASE_CHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
View Source
const NormalConsoleWidth = 80
Variables ¶
This section is empty.
Functions ¶
func AcceptMimeType ¶
func CheckCertWithDomain ¶
func CheckCertWithDomain(cert *x509.Certificate, domain string) bool
func CheckCertWithTime ¶
func CheckCertWithTime(cert *x509.Certificate, gracePeriod time.Duration) bool
func CheckIfSubPath ¶
func CheckIfSubPathNotEqual ¶
func CleanFilePathAbs ¶
func EncodePrivateKeyToPEM ¶
func EncodePrivateKeyToPEM(privateKey crypto.PrivateKey) ([]byte, error)
func ExitByError ¶
func ExitByErrorMsg ¶
func FilePathEqual ¶
func FormatTextToWidth ¶
func GetArgs0Name ¶
func GetArgs0Name() string
func GetGoVersionMajor ¶
func GetGoVersionMajorMust ¶
func GetGoVersionMajorMust() int64
func GetGoVersionMinor ¶
func GetGoVersionMinorMust ¶
func GetGoVersionMinorMust() int64
func GetGoVersionPatch ¶
func GetGoVersionPatchMust ¶
func GetGoVersionPatchMust() int64
func InvalidPhone ¶
func IsGoodQueryKey ¶
func IsValidDomain ¶
func IsValidEmail ¶
func IsValidHTTPHeaderKey ¶
func IsValidIPv4CIDR ¶
func IsValidIPv6CIDR ¶
IsValidIPv6CIDR checks if the given string is a valid IPv6 CIDR notation.
func IsValidURLPath ¶
func ProcessURLPath ¶
设计理念: 通过把UPath添加'/',然后去除右端'/',实现url转换为'/abc'格式。 如此格式,恶意满足拼接的需求。 对于根路由,即'/',则转换为空白符好。
func ReadCertificate ¶
func ReadCertificate(data []byte) (*x509.Certificate, error)
func ReadPrivateKey ¶
func ReadPrivateKey(data []byte) (crypto.PrivateKey, error)
func SayGoodByef ¶
func SayGoodByef(format string, args ...interface{})
func SplitHostPort ¶
func StringToOnlyPrint ¶
Types ¶
type StringBool ¶
type StringBool string
func (*StringBool) IsDisable ¶
func (s *StringBool) IsDisable(defaultVal ...bool) (res bool)
func (*StringBool) IsEnable ¶
func (s *StringBool) IsEnable(defaultVal ...bool) (res bool)
func (*StringBool) SetDefaultDisable ¶
func (s *StringBool) SetDefaultDisable()
func (*StringBool) SetDefaultEnable ¶
func (s *StringBool) SetDefaultEnable()
func (*StringBool) ToBool ¶
func (s *StringBool) ToBool(defaultVal ...bool) bool
func (*StringBool) ToString ¶
func (s *StringBool) ToString() string
func (*StringBool) ToStringDefaultDisable ¶
func (s *StringBool) ToStringDefaultDisable() string
func (*StringBool) ToStringDefaultEnable ¶
func (s *StringBool) ToStringDefaultEnable() string
Click to show internal directories.
Click to hide internal directories.