toolsbox

package
v0.0.0-...-b92253b Latest Latest
Warning

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

Go to latest
Published: May 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ROOTPATH = os.Getenv("OCTOOLS_HOME")

Functions

func ArrayToMap

func ArrayToMap[T basicdata](originarr []T) (res map[T]struct{})

transfer 1D array to map,make sure your array's data were not repeat

func CheckArgs

func CheckArgs[T any](args []string, originmap map[string]T) bool

func Comparecounts

func Comparecounts[T basicmath](originlist []T, newlist []T) bool

need compare array,compare array

func ExportMapKeys

func ExportMapKeys[T string | int | float64 | byte](originmap map[string]T) (res []string)

func ExportMapKeysAny

func ExportMapKeysAny[T interface{}](originmap map[string]T) (res []string)

the map value is unlimited

func ExportMapKeysArrayEdition

func ExportMapKeysArrayEdition[T string | int | float64 | byte](originmap map[T][]any) (res []T)

func ExportMapValue

func ExportMapValue[T string | int | float64 | byte](originmap map[string]T) (res []T)

func FindNumberFromString

func FindNumberFromString(origin string) (int, float64, bool, bool)

return int,float,isfloat,isexsit

func FormatList

func FormatList(origin map[string]string, path string) (bool, error)

func FormatListBySymbol

func FormatListBySymbol(origin map[string]string, path, symbol string) (bool, error)

advanced method for format the map to file

func FormatListUltra

func FormatListUltra(origin map[string]string, symbol string) (res string)

foramt the map to string and custom spilt sybol freely

func GetBaseName

func GetBaseName(path string) string

func GetDirPath

func GetDirPath(path string) string

func LogInit

func LogInit(logname, filepath string) *log.Logger

func MakeRandArray

func MakeRandArray(length int, args []int) []int

length int,{max,min}(option)

func Md5

func Md5(content []byte) []byte

md5 encrypt

func ParseList

func ParseList(path string) (map[string]string, error)

func ParseListBySymbol

func ParseListBySymbol(path, symbol string) (res map[string]string, err error)

advance parser method

func ParseListUltra

func ParseListUltra(content []byte, symbol string) (res map[string]string, err error)

parse the bytes array to the target map,split by custom symbol freely

func ProcessFinished

func ProcessFinished(pro *Process)

func ProcessRun

func ProcessRun(pro *Process, end *bool)

0 hidden 1 show

func RandomMake

func RandomMake(length int) string

func ScanPlugin

func ScanPlugin(filepath string) (pluginer *plugin.Plugin, err error)

scan plugin by full path

func ScanPluginByName

func ScanPluginByName(plugin_name, rootpath string) (pluginer *plugin.Plugin, err error)

scan plugin by plugin name ,input plugin name and root path of plugin

func Sha256

func Sha256(content []byte) []byte

sha256 encrypt

func SortArray

func SortArray[T basicmath](array []T) []T

func TestSort

func TestSort()

Types

type Process

type Process struct {
	Pos chan uint
	// contains filtered or unexported fields
}

func ProcessInit

func ProcessInit(putchar byte) *Process

Jump to

Keyboard shortcuts

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