Documentation ¶
Overview ¶
*********************************************************************************************** *** G O L A N D *** *********************************************************************************************** * Auth: ColeCai * Date: 2023/10/19 13:18:32 * Proj: work * Pack: tools * File: excel.go *---------------------------------------------------------------------------------------------- * Overviews: *---------------------------------------------------------------------------------------------- * Functions: * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*********************************************************************************************** *** G O L A N D *** *********************************************************************************************** * Auth: ColeCai * Date: 2023/10/23 14:43:29 * Proj: work * Pack: tools * File: psutil.go *---------------------------------------------------------------------------------------------- * Overviews: *---------------------------------------------------------------------------------------------- * Functions: * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*********************************************************************************************** *** G O L A N D *** *********************************************************************************************** * Auth: ColeCai * Date: 2023/10/19 13:19:08 * Proj: work * Pack: tools * File: tools.go *---------------------------------------------------------------------------------------------- * Overviews: *---------------------------------------------------------------------------------------------- * Functions: * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index ¶
- Constants
- func BytesToString(b []byte) string
- func GetMessageName(m proto.Message) string
- func GetRandomString(l int, with WithBase) string
- func GetRandomToken() string
- func MatrixIntsToStrs[T constraints.Integer](arrays [][]T) [][]string
- func MatrixStrsToInts[T constraints.Integer](arrays [][]string) ([][]T, error)
- func NewProtoMessage(name string) (proto.Message, error)
- func ReverseSlice[T any](slice []T) []T
- func SliceCntElem[T comparable](slice []T, elem T) int
- func SliceDelElemAll[T comparable](slice []T, elem T) []T
- func SliceHasElem[T comparable](slice []T, elem T) bool
- func SliceIntsToStrs[T constraints.Integer](array []T) []string
- func SliceStrsToInts[T constraints.Integer](array []string) ([]T, error)
- func SliceStrsToInts1[T constraints.Integer](array []string, tp []T) error
- func SlicesDifferSet[T comparable](slice1, slice2 []T) []T
- func SlicesInterSet[T comparable](slice1, slice2 []T) []T
- func StringToBytes(s string) []byte
- func WithAlpha() string
- func WithLower() string
- func WithNumberAndAlpha() string
- func WithNumberAndLower() string
- func WithNumberAndUpper() string
- func WithNumnber() string
- func WithUpper() string
- type BytePool
- type Delay
- type Excel
- func (e *Excel) Close()
- func (e *Excel) GetCellValue(sheetName, pos string) (string, error)
- func (e *Excel) GetColMatrix(sheetName, startPos, endPos string) ([][]string, error)
- func (e *Excel) GetColsValue(sheetName, startPos, endPos string) ([]string, error)
- func (e *Excel) GetRowMatrix(sheetName, startPos, endPos string) ([][]string, error)
- func (e *Excel) GetRowsValue(sheetName, startPos, endPos string) ([]string, error)
- func (e *Excel) Open(file string) error
- type ProcSysInfo
- type WithBase
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
func GetMessageName ¶
func GetRandomString ¶
func GetRandomToken ¶
func GetRandomToken() string
func MatrixIntsToStrs ¶
func MatrixIntsToStrs[T constraints.Integer](arrays [][]T) [][]string
func MatrixStrsToInts ¶
func MatrixStrsToInts[T constraints.Integer](arrays [][]string) ([][]T, error)
func ReverseSlice ¶
func ReverseSlice[T any](slice []T) []T
func SliceCntElem ¶
func SliceCntElem[T comparable](slice []T, elem T) int
func SliceDelElemAll ¶
func SliceDelElemAll[T comparable](slice []T, elem T) []T
func SliceHasElem ¶
func SliceHasElem[T comparable](slice []T, elem T) bool
func SliceIntsToStrs ¶
func SliceIntsToStrs[T constraints.Integer](array []T) []string
func SliceStrsToInts ¶
func SliceStrsToInts[T constraints.Integer](array []string) ([]T, error)
func SliceStrsToInts1 ¶
func SliceStrsToInts1[T constraints.Integer](array []string, tp []T) error
func SlicesDifferSet ¶
func SlicesDifferSet[T comparable](slice1, slice2 []T) []T
func SlicesInterSet ¶
func SlicesInterSet[T comparable](slice1, slice2 []T) []T
func StringToBytes ¶
func WithNumberAndAlpha ¶
func WithNumberAndAlpha() string
func WithNumberAndLower ¶
func WithNumberAndLower() string
func WithNumberAndUpper ¶
func WithNumberAndUpper() string
func WithNumnber ¶
func WithNumnber() string
Types ¶
type BytePool ¶
type BytePool struct {
// contains filtered or unexported fields
}
func NewBytePool ¶
func (*BytePool) PutWithReset ¶
type Excel ¶
type Excel struct {
// contains filtered or unexported fields
}
func (*Excel) GetColMatrix ¶
列做一维
func (*Excel) GetColsValue ¶
按列获取
func (*Excel) GetRowMatrix ¶
行做一维
func (*Excel) GetRowsValue ¶
按行获取
type ProcSysInfo ¶
type ProcSysInfo struct { Pid int Name string CPUPercent float64 MemPercent float64 UsedMem uint64 CreatTime int64 }
func GetProcSysInfo ¶
func GetProcSysInfo() (*ProcSysInfo, error)