Documentation ¶
Index ¶
- func ClapNumber[T NumericType](n, left, right T) T
- func ClearFile(path string) error
- func EqualFold(s, t string) bool
- func FileExists(path string) (has bool, err error)
- func Find[T any](s []T, f func(T) bool) *T
- func FindIndexOf[T any](s []T, f func(T) bool) int
- func GBKToUTF8(b []byte) []byte
- func Gzip(b []byte) []byte
- func IndexOf[T comparable](s []T, e T) int
- func LastIndexOf[T comparable](s []T, e T) int
- func Lower(b byte) byte
- func MapToStruct(m, s any) error
- func MarshalBeautyJSON(v any) ([]byte, error)
- func MaxNumber[T NumericType](a, b T) T
- func MinNumber[T NumericType](a, b T) T
- func NumericAdd[T NumericType](a, b T) T
- func NumericMinus[T NumericType](a, b T) T
- func ParseLocalTime(s string) (t time.Time)
- func RandomNumeric[T NumericType](left, right T) (res T)
- func StringCut(s, sep string) (before, after string, found bool)
- func StripSpaces(str string) string
- func ToMd5(str string) string
- func UnGzip(b []byte) ([]byte, error)
- func UnGzipToJson[T any](v *T, b []byte) (*T, error)
- type FileTailLine
- type Node
- type NumericType
- type Response
- func (res *Response) BodyBytes() ([]byte, error)
- func (res *Response) BodyJSON(v any) error
- func (res *Response) BodyString() (string, error)
- func (res *Response) PathVar(v string) []string
- func (res *Response) RespErr(data any)
- func (res *Response) RespJSON(httpCode int, body any)
- func (res *Response) RespNoAuth(data any)
- func (res *Response) RespOk(data any)
- type Ternary
- type Tree
- type WaitGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClapNumber ¶
func ClapNumber[T NumericType](n, left, right T) T
func EqualFold ¶
EqualFold is strings.EqualFold, ASCII only. It reports whether s and t are equal, ASCII-case-insensitively.
func FindIndexOf ¶
func IndexOf ¶
func IndexOf[T comparable](s []T, e T) int
func LastIndexOf ¶
func LastIndexOf[T comparable](s []T, e T) int
func MapToStruct ¶
MapToStruct marshal map and then unmarshal to struct s must be a pointer of variable
func MarshalBeautyJSON ¶
MarshalBeautyJSON return beauty json
func MaxNumber ¶
func MaxNumber[T NumericType](a, b T) T
func MinNumber ¶
func MinNumber[T NumericType](a, b T) T
func NumericAdd ¶
func NumericAdd[T NumericType](a, b T) T
func NumericMinus ¶
func NumericMinus[T NumericType](a, b T) T
func ParseLocalTime ¶
ParseLocalTime Parse string to local time
func RandomNumeric ¶
func RandomNumeric[T NumericType](left, right T) (res T)
func StringCut ¶
Cut slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, "", false.
func UnGzipToJson ¶
Types ¶
type FileTailLine ¶
type NumericType ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse(w *http.ResponseWriter, r *http.Request) Response
func (*Response) BodyString ¶
func (*Response) RespNoAuth ¶
Click to show internal directories.
Click to hide internal directories.