Documentation
¶
Index ¶
- func Call(fns ...func() error) error
- func CallWith[T any](val T, fns ...func(T) error) error
- func CharsetByType(typ string) string
- func Decode62(str string) int64
- func Encode62(num int64) string
- func ExtensionByType(mimeType string) string
- func Interpolate(template, startTag, endTag string, w io.Writer, f TagFunc) (int64, error)
- func IsZero[T any](v T) bool
- func MD5(str string) string
- func MustCall(fns ...func() error)
- func MustCallWith[T any](val T, fns ...func(T) error)
- func PasswordHash(password string) (string, error)
- func PasswordVerify(password, hash string) bool
- func Sha1(str string) string
- func Sha256(str string) string
- func SliceByteToString(b []byte) string
- func StringToSliceByte(s string) []byte
- func Strtr(template string, data map[string]any) (string, error)
- func Strtr2(template, startTag, endTag string, data map[string]any) (string, error)
- func TypeByExtension(ext string) string
- func Wrap(fns ...func() error) func() error
- func WrapWith[T any](fns ...func(T) error) func(val T) error
- type TagFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CharsetByType ¶
func ExtensionByType ¶
func Interpolate ¶
Interpolate calls f on each template tag (placeholder) occurrence.
Returns the number of bytes written to w.
func IsZero ¶
IsZero 泛型零值判断 https://stackoverflow.com/questions/74000242/in-golang-how-to-compare-interface-as-generics-type-to-nil
func MustCallWith ¶
func PasswordHash ¶
func PasswordVerify ¶
func SliceByteToString ¶
func StringToSliceByte ¶
func TypeByExtension ¶
Types ¶
type TagFunc ¶
TagFunc can be used as a substitution value in the map passed to Interpolate. Interpolate functions pass tag (placeholder) name in 'tag' argument.
TagFunc must be safe to call from concurrently running goroutines.
TagFunc must write contents to w and return the number of bytes written.
Click to show internal directories.
Click to hide internal directories.