Documentation
¶
Overview ¶
Package utils provide useful functions for skynet.
Index ¶
- func CalcPage(page int, size int, len int) (int, int, bool)
- func CheckVersion(ver string, constraint string) (bool, error)
- func DownloadFile(ctx context.Context, url string, path string) error
- func FileExist(path string) bool
- func MD5(str string) string
- func Max[T constraints.Ordered](a T, b T) T
- func Min[T constraints.Ordered](a T, b T) T
- func MustMarshal(v any) string
- func RandString(n int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
CheckVersion checks ver with constraint string.
CheckVersion("1.0.1", ">= 1.0, < 1.1")
func DownloadFile ¶
DownloadFile download url to path.
func Max ¶
func Max[T constraints.Ordered](a T, b T) T
func Min ¶
func Min[T constraints.Ordered](a T, b T) T
func MustMarshal ¶
func RandString ¶
RandString returns n length random string [a-zA-Z0-9]+
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.