Documentation
¶
Index ¶
- Constants
- Variables
- func AlignString(s string, length int) (ss string)
- func Atoi(s string) int
- func BaseName(path string) string
- func Concat[S ~[]E, E any](slices_ ...S) S
- func ConvertUtf82Gbk(src string) (ss string)
- func CopyDir(dst, src string) error
- func CopyFile(path, dstPath string)
- func CreatDirectory(dir string) bool
- func CurrentDirName(path string) (currentDirName string)
- func CutUint16(u uint16) uint8
- func CutUint16_(u uint16) uint8
- func DirDepth(dirPath string) (depth int)
- func FileServer()
- func FileServerFS(fs embed.FS)
- func FixUncPath(path string) string
- func Float64Cut(value float64, bits int) (float64, error)
- func Float64ToString(f float64, prec int) string
- func FormatDuration(d time.Duration) string
- func FormatTime(t time.Time) string
- func Gbk2Utf8(gbk string) (utf8 string)
- func GenA2Z() (letters []string)
- func GetDiffDays(dstTime string) string
- func GetLocalIPs() []net.IP
- func GetPackageName() (pkgName string)
- func GetTimeNowString() string
- func GetTimeStamp() string
- func GetTimeStamp13Bits() int64
- func GetUserConfigDirs() (UserConfigDirs map[string]string)
- func GetWindowsLogicalDrives() []string
- func GitProxy(isSetProxy bool)
- func GoReleaser()
- func HomeDir() string
- func IntegerToIP(ip int64) string
- func IsAix() bool
- func IsAndroid() bool
- func IsDarwin() bool
- func IsDir(path string) bool
- func IsDirEx(path string) (ok bool)
- func IsDirRoot(path string) bool
- func IsDragonfly() bool
- func IsFilePath(path string) bool
- func IsFilePathEx(path string) (ok bool)
- func IsFreebsd() bool
- func IsHurd() bool
- func IsIllumos() bool
- func IsIos() bool
- func IsJs() bool
- func IsLinux() bool
- func IsNacl() bool
- func IsNetbsd() bool
- func IsOpenbsd() bool
- func IsPlan9() bool
- func IsSolaris() bool
- func IsTermux() bool
- func IsWasip1() bool
- func IsWindows() bool
- func IsZero(v reflect.Value) bool
- func IsZos() bool
- func JoinHomeDir(path string) (join string)
- func JoinHomeFile(path string) (join string)
- func JsonIndent(b []byte) string
- func Lines(x []byte) []string
- func MakeCommandArg(arg ...string) string
- func MarshalJSON(v any) []byte
- func MarshalJsonToFile(v any, name string)
- func MoveFile(src, dst string)
- func NewVersion[T string | uint64](s ...T) (v *object)
- func ParseFloat(sizeStr string) (size float64)
- func ParseInt(s string) int64
- func ParseUint(s string) uint64
- func RandomAny[T any](slice []T) T
- func ReadEmbedFileMap(embedFiles embed.FS, dir string) *maps.SafeMap[string, []byte]
- func ReadFileToLines(path string) (lines []string)
- func ReadLines(fullPath string) ([]string, error)
- func ReflectVisibleFields(object any) []reflect.StructField
- func RegexpWebBodyBlocks(tagName string) string
- func RunDir() string
- func SerialNumber(b string) string
- func SetNameAndEmail(s *Buffer)
- func SetProxy(s *Buffer, isSetProxy bool)
- func SetSafecrlf(s *Buffer)
- func SlicesIndex(slice any, item any) int
- func SlicesInsert(slice any, index int, value any) any
- func SplitFileByLines(filePath string, size int)
- func SubStrRunes(s string, length int) string
- func SwapBytes(src []byte) (dst []byte)
- func SwapBytes2HexString2(src HexString) (dst string)
- func ToCamel(data string, isCommit bool) string
- func ToCamelToLower(s string, isCommit bool) string
- func ToCamelUpper(s string, isCommit bool) string
- func ToLines[T string | []byte | *os.File | *bytes.Buffer](data T) (lines []string)
- func TrimExtension(path string) string
- func UnFormatDuration(s string) time.Duration
- func UnFormatTime(s string) time.Time
- func Unquote(line string) string
- func UpdateModsByWorkSpace(isTidy, isUpdateAll bool, modWithCommitID ...string)
- func Utf82Gbk(utf8 string) (gbk string)
- func WriteAppend[T Type](name string, data T)
- func WriteBinaryFile[T Type](name string, data T)
- func WriteGoFile[T Type](name string, data T)
- func WriteLines(lines []string, fullPath string) error
- func WriteTruncate[T Type](name string, data T)
- type AppKind
- type Buffer
- func (b *Buffer) AppendByteSlice(bytesSlice ...[]byte) []byte
- func (b *Buffer) BigNumXorWithAlign(arg1, arg2 []byte, align int) (xorStream []byte)
- func (b *Buffer) CheckDesBlockSize()
- func (b *Buffer) Contains(substr string) bool
- func (b *Buffer) CutString(left, right string) (cut string, found bool)
- func (b *Buffer) CutWithIndex(x, y int) []byte
- func (b *Buffer) HexString() HexString
- func (b *Buffer) HexStringUpper() HexString
- func (b *Buffer) Indent(deep int)
- func (b *Buffer) InsertByte(index int, ch byte)
- func (b *Buffer) InsertBytes(index int, insert []byte) []byte
- func (b *Buffer) InsertRune(index int, r rune)
- func (b *Buffer) InsertString(index int, s string) string
- func (b *Buffer) InsertStringWithSplit(size int, insert string) string
- func (b *Buffer) LinesToString(lines []string) string
- func (b *Buffer) MergeByte(streams ...[]byte) []byte
- func (b *Buffer) NewLine() *Buffer
- func (b *Buffer) ObjectBegin()
- func (b *Buffer) ObjectEnd()
- func (b *Buffer) Quote()
- func (b *Buffer) QuoteWith(s string) *Buffer
- func (b *Buffer) ReadBinary(order binary.ByteOrder) (data any)
- func (b *Buffer) ReaderGzip() *Buffer
- func (b *Buffer) ReplaceAll(old, new string) *Buffer
- func (b *Buffer) SliceBegin()
- func (b *Buffer) SliceEnd()
- func (b *Buffer) SplitBytes(size int) (blocks [][]byte)
- func (b *Buffer) SplitString(size int) (blocks []string)
- func (b *Buffer) ToLines() (lines []string)
- func (b *Buffer) WriteBinary(order binary.ByteOrder, data any)
- func (b *Buffer) WriteBytesLn(buf []byte) *Buffer
- func (b *Buffer) WritePackageName()
- func (b *Buffer) WriteStringLn(s string) *Buffer
- type CommandSession
- type GeneratedFile
- type HexDumpString
- type HexString
- type Interface
- type Pool
- type Type
Constants ¶
View Source
const TimeLayout = "2006-01-02 15:04:05"
Variables ¶
View Source
var ( RegexpIp = regexp.MustCompile(`((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))`) // todo panic RegexpIpPort = regexp.MustCompile(`((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))):([0-9]+)`) )
View Source
var DefaultFileServerPort = ":8080"
View Source
var RegexpCenter = `(.+?)`
Functions ¶
func AlignString ¶
func ConvertUtf82Gbk ¶
func CreatDirectory ¶
func CurrentDirName ¶
func CutUint16_ ¶
func FileServer ¶ added in v0.0.17
func FileServer()
func FileServerFS ¶ added in v0.0.17
func FixUncPath ¶
func Float64ToString ¶
func FormatDuration ¶
func FormatTime ¶
func GetDiffDays ¶
func GetLocalIPs ¶ added in v0.0.17
func GetPackageName ¶
func GetPackageName() (pkgName string)
func GetTimeNowString ¶
func GetTimeNowString() string
func GetTimeStamp ¶
func GetTimeStamp() string
func GetTimeStamp13Bits ¶
func GetTimeStamp13Bits() int64
func GetUserConfigDirs ¶
func GetWindowsLogicalDrives ¶ added in v0.0.17
func GetWindowsLogicalDrives() []string
func GoReleaser ¶ added in v0.0.9
func GoReleaser()
func IntegerToIP ¶
func IsDragonfly ¶
func IsDragonfly() bool
func IsFilePath ¶
func IsFilePathEx ¶ added in v0.0.23
func JoinHomeDir ¶
func JoinHomeFile ¶
func JsonIndent ¶
func Lines ¶
Lines returns the lines in the file x, including newlines. If the file does not end in a newline, one is supplied along with a warning about the missing newline.
func MakeCommandArg ¶ added in v0.0.16
func MarshalJSON ¶
func MarshalJsonToFile ¶
func NewVersion ¶
func ParseFloat ¶
func ReadEmbedFileMap ¶ added in v0.0.11
func ReadFileToLines ¶
func ReflectVisibleFields ¶ added in v0.0.14
func ReflectVisibleFields(object any) []reflect.StructField
func RegexpWebBodyBlocks ¶
func SetNameAndEmail ¶
func SetNameAndEmail(s *Buffer)
func SetSafecrlf ¶
func SetSafecrlf(s *Buffer)
func SlicesIndex ¶
func SubStrRunes ¶
func SwapBytes2HexString2 ¶
SwapBytes2HexString2 逆序,并不是交换 todo 重命名为 Reverse,如果输入参数复合8字节以下的字节对齐可以用二进制包,不过不通用
func ToCamelToLower ¶
func ToCamelUpper ¶
func TrimExtension ¶
func UnFormatDuration ¶
func UnFormatTime ¶
func UpdateModsByWorkSpace ¶
func WriteAppend ¶
func WriteBinaryFile ¶
func WriteGoFile ¶
func WriteLines ¶
func WriteTruncate ¶
Types ¶
type AppKind ¶
type AppKind byte
const ( SuperRecovery4Kind AppKind = iota AneData6Kind ChaoQiangZhaoPianKind DataExploreKind DiskGetorKind DocxBuildKind ExcelHuiFuZhuanJiaKind ExcelRebuild1Kind ExcelRebuild3Kind ExcelScanKind HykHfKind Jphf3Kind MailScanKind OfficeBuildKind OfficeZipBuildKind PptxBuildKind SuperRecovery2Kind WordRepairerKind WordScanKind XlsxBuildKind ZipBuildKind InvalidAppKind )
func ConvertInteger2AppKind ¶
func ConvertInteger2AppKind[T constraints.Integer](v T) AppKind
func (AppKind) AssertKind ¶
func (AppKind) SvgFileName ¶
type Buffer ¶
func NewHexDump ¶
func NewHexDump(hexdumpStr HexDumpString) (data *Buffer)
func NewHexString ¶
func ReaderGzip ¶
func (*Buffer) AppendByteSlice ¶
func (*Buffer) BigNumXorWithAlign ¶
func (*Buffer) CheckDesBlockSize ¶
func (b *Buffer) CheckDesBlockSize()
func (*Buffer) CutWithIndex ¶
func (*Buffer) HexStringUpper ¶
func (*Buffer) InsertByte ¶
func (*Buffer) InsertRune ¶
func (*Buffer) InsertStringWithSplit ¶
func (*Buffer) LinesToString ¶
func (*Buffer) ObjectBegin ¶
func (b *Buffer) ObjectBegin()
func (*Buffer) ReaderGzip ¶
func (*Buffer) ReplaceAll ¶
func (*Buffer) SliceBegin ¶
func (b *Buffer) SliceBegin()
func (*Buffer) SplitBytes ¶
func (*Buffer) SplitString ¶
func (*Buffer) WriteBytesLn ¶
func (*Buffer) WritePackageName ¶
func (b *Buffer) WritePackageName()
func (*Buffer) WriteStringLn ¶
type CommandSession ¶ added in v0.0.16
type CommandSession struct {
*exec.Cmd
Result string
CurrentDirectory string
// contains filtered or unexported fields
}
func NewCommandSession ¶ added in v0.0.16
func NewCommandSession() *CommandSession
func RunCommand ¶
func RunCommand(command string) *CommandSession
func RunCommandArgs ¶ added in v0.0.16
func RunCommandArgs(arg ...string) *CommandSession
func (*CommandSession) GetPid ¶ added in v0.0.16
func (s *CommandSession) GetPid() <-chan int
func (*CommandSession) SetDir ¶ added in v0.0.16
func (s *CommandSession) SetDir(dir string)
func (*CommandSession) SetLog ¶ added in v0.0.16
func (s *CommandSession) SetLog(wr io.Writer)
type GeneratedFile ¶
type GeneratedFile struct {
// contains filtered or unexported fields
}
func (*GeneratedFile) Buffer ¶ added in v0.0.15
func (g *GeneratedFile) Buffer() *bytes.Buffer
func (*GeneratedFile) Enum ¶
func (g *GeneratedFile) Enum(kindName string, kinds, tooltip []string)
func (*GeneratedFile) P ¶
func (g *GeneratedFile) P(v ...any)
func (*GeneratedFile) ReadTemplates ¶
func (g *GeneratedFile) ReadTemplates(path string)
type HexDumpString ¶
type HexDumpString string
type Interface ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package constraints defines a set of useful constraints to be used with type parameters.
|
Package constraints defines a set of useful constraints to be used with type parameters. |
|
Package datasize provides a data size type and constants.
|
Package datasize provides a data size type and constants. |
|
deepcopy makes deep copies of things.
|
deepcopy makes deep copies of things. |
|
net
|
|
|
transport/tcp/m
command
|
|
|
script
|
|
|
Package taskqueue provides a simple asynchronous task queue.
|
Package taskqueue provides a simple asynchronous task queue. |
|
Package txt provides various text utilities.
|
Package txt provides various text utilities. |
|
Package xlsx provides the ability to extract text from Excel spreadsheets.
|
Package xlsx provides the ability to extract text from Excel spreadsheets. |
Click to show internal directories.
Click to hide internal directories.