util

package
v0.0.0-...-026689c Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeList2ListNode

func ChangeList2ListNode(list []int) *config.ListNode

func Compress

func Compress(files []*os.File, dest string) error

压缩 使用gzip压缩成tar.gz

func Cut

func Cut(tag string, subTag string)

func DeCompress

func DeCompress(tarFile, dest string) error

解压 tar.gz

func FileExist

func FileExist(path string) bool

func GenerateRangeNum

func GenerateRangeNum(min, max int) int

func GetRandomName

func GetRandomName(retry int) string

GetRandomName generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3`

func GetZip

func GetZip(w io.Writer) error

func InitListNodes

func InitListNodes(linkNum int) *config.ListNode

func InitListRandNodes

func InitListRandNodes(linkNum int) *config.ListNode

func InitListSortRandNodes

func InitListSortRandNodes(linkNum int) *config.ListNode

func InitNoRepeatRandArrayRange

func InitNoRepeatRandArrayRange(num int, min int, max int) []int

func InitRandArray

func InitRandArray(num int) []int

func InitRandArrayRange

func InitRandArrayRange(num int, min int, max int) []int

func InitRandCycleLinkedList

func InitRandCycleLinkedList(linkNum int, pos int) *config.ListNode

func InitRandLevelArrayRange

func InitRandLevelArrayRange(level int, num int, min int, max int) [][]int
func InitRangeLinkList(linkNum int, min int, max int) *config.ListNode

func LinkedListPrint

func LinkedListPrint(head *config.ListNode) []int

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func PrintLevelArray

func PrintLevelArray(levelArr [][]int)

func RandStringBytesMask

func RandStringBytesMask(n int) string

func RandStringBytesMaskImprSrc

func RandStringBytesMaskImprSrc(n int) string

func Start

func Start(tag string, subTag string)

Types

type Exception

type Exception struct {
	Id  int    // exception id
	Msg string // exception msg
}

func Throw

func Throw(id int, msg string) Exception

type ExceptionHandler

type ExceptionHandler func(Exception)

type TimeCut

type TimeCut struct {
	// contains filtered or unexported fields
}

type TryStruct

type TryStruct struct {
	// contains filtered or unexported fields
}

func Try

func Try(tryHandler func()) *TryStruct

func (*TryStruct) Catch

func (this *TryStruct) Catch(exceptionId int, catch func(Exception)) *TryStruct

func (*TryStruct) Finally

func (this *TryStruct) Finally(finally func())

Jump to

Keyboard shortcuts

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