xtools

package
v0.0.0-...-01a1177 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TIME_SECOND = 1
	TIME_MINUTE = 60 * TIME_SECOND
	TIME_HOUR   = 60 * TIME_MINUTE
)

Variables

This section is empty.

Functions

func AllocateDisk

func AllocateDisk(n int) string

func ConvertPercent

func ConvertPercent(src float64) string

func FormatSecondToDuration

func FormatSecondToDuration(second int64) string

func GetFileMD5

func GetFileMD5(path string) (string, error)

func GetFileSHA1

func GetFileSHA1(path string) (string, error)

func GetLocalPublicIP

func GetLocalPublicIP() (string, error)

func Hang

func Hang()

func KeepFloatNum

func KeepFloatNum(src float64, num int) (float64, error)

func MarshalBytesMatrix

func MarshalBytesMatrix(str string) ([][]byte, error)

用于处理岛屿类题目中的测试case转换为可用结构

func MarshalIntSlice

func MarshalIntSlice() ([]int, error)

用于牛客的数列类题目的输入输出

func Max

func Max(data ...int) int

func NewFileLogrus

func NewFileLogrus(path string) *logrus.Logger

func Pow

func Pow(x, y int) int

func ReadFileInLine

func ReadFileInLine(path string) ([]string, error)

func SetHashBlock

func SetHashBlock(size int64)

func TimeNow

func TimeNow() string

func UseDefaultLogrus

func UseDefaultLogrus()

func UseDefaultLogs

func UseDefaultLogs()

func WriteFileInLine

func WriteFileInLine(path string, data []string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL