Documentation
¶
Index ¶
- Constants
- func AllowCORS(h http.Handler) http.Handler
- func CatchError(detail string, err error)
- func CreateDir(dirs ...string) (err error)
- func FirstDayOfLastMonth() string
- func GrpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Handler
- func IsChinese(str string) []int
- func IsGBK(data []byte) bool
- func IsUtf8(data []byte) bool
- func LastDayOfLastMonth() string
- func ParseTime(datestr string) (time.Time, error)
- func PathExists(path string) (bool, error)
- func Random() string
- func ReaderText(readerfile string) (string, error)
- func WirteText(savefile string, txt string)
Constants ¶
View Source
const DATE_FORMAT = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
func AllowCORS ¶
allowCORS allows Cross Origin Resoruce Sharing from any origin. Don't do this without consideration in production systems.
func CatchError ¶
func GrpcHandlerFunc ¶
用于判断请求是来源于Rpc客户端还是Restful Api的请求, 根据不同的请求注册不同的ServeHTTP服务;r.ProtoMajor == 2也代表着请求必须基于HTTP/2
func PathExists ¶
func ReaderText ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.