Documentation
¶
Index ¶
- Constants
- func ContainsCJKChar(s string) bool
- func Invoke0(ctx context.Context, funcToBeRan func() error) error
- func Print(inputs ...interface{})
- func PrintJSON(inputs ...interface{})
- func RandBytes(length ...int) ([]byte, error)
- func RandomBase64Token(length ...int) (string, error)
- func RandomHashString(length ...int) string
- func RandomInt64(max ...int64) int64
- func RandomInt64InRange(min, max int64) int64
- func RandomInt64String(digits int64) string
- func ReadFileAsBytesBuffer(path string) (*bytes.Buffer, error)
- func RelativePathBasedOnPwdOf(fp string) string
- func RelativePathOf(fp string) string
- func Sprint(inputs ...interface{}) string
- func SprintJSON(inputs ...interface{}) string
Constants ¶
View Source
const ( // KB = 1024. BytesUnitKB = 1024 // MB = 1024 * KB. BytesUnitMB = 1024 * BytesUnitKB // GB = 1024 * MB. BytesUnitGB = 1024 * BytesUnitMB )
Bytes Units.
Variables ¶
This section is empty.
Functions ¶
func ContainsCJKChar ¶
func RandomBase64Token ¶
RandomBase64Token 根据给定的字节长度生成 URL 安全的 Base64 字符串,长度默认为 32 长度为原始字节数据的长度,并非 Base64 字符串实际长度,默认 32 情况下实际长度约为 44。
func RandomHashString ¶
RandomHashString 生成随机 SHA256 字符串,最大长度为 64。
func RandomInt64InRange ¶
RandomInt64InRange 在区间内生成随机整数。
func Sprint ¶
func Sprint(inputs ...interface{}) string
Sprint 格式化输出所有传入的值的字段、值、类型、大小,并返回字符串。
NOTICE: 包含换行符。
func SprintJSON ¶
func SprintJSON(inputs ...interface{}) string
SprintJSON 格式化输出 JSON 格式并返回字符串。
NOTICE: 包含换行符。
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.