Documentation
¶
Index ¶
- Constants
- Variables
- func AlignString(s string, length int) (ss string)
- func Atoi(s string) int
- func BaseName(path string) string
- func Bool2Integer[T Integer](b bool) T
- func Concat[S ~[]E, E any](slices_ ...S) S
- func ConvertUtf82Gbk(src string) string
- func CopyDir(dst, src string)
- func CopyFile(path, dstPath string)
- func CreatDirectory(dir string) bool
- func CurrentDirName(path string) (currentDirName string)
- func DirDepth(dirPath string) (depth int)
- func DumpHex[T []byte | *bytes.Buffer](buf T) (dump string)
- func FileServer()
- func FileServerFS(fs embed.FS)
- func FixFilePath(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 FormatInteger[T Integer](data T) string
- func FormatIntegerHex[T Integer](data T) string
- func FormatIntegerHex0x[T Integer](data T) string
- func FormatTime(t time.Time) string
- func Gbk2Utf8(gbk string) (utf8 string)
- func GenA2Z() (letters []string)
- func GenMask()
- func GetAvailablePort() int
- 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 Integer2Bool[T Integer](value T) bool
- func IntegerToIP(ip int64) string
- func IsASCIIAlpha(s string) bool
- func IsASCIIDigit(s string) bool
- func IsAix() bool
- func IsAlphanumeric(s string) 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 IsIncludeLine(s string) bool
- func IsIos() bool
- func IsJs() bool
- func IsLinux() bool
- func IsNacl() bool
- func IsNetbsd() bool
- func IsOpenbsd() bool
- func IsPlan9() bool
- func IsPortAvailable(port int) 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 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 Permute[T comparable](data []T) [][]T
- func PermuteToUint32Slice(slice [][]byte) []uint32
- func RandomAny[T any](slice []T) T
- func ReadEmbedFileMap(embedFiles embed.FS, dir string) *safemap.M[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 SetNameAndEmail(s *Buffer)
- func SetProxy(s *Buffer, isSetProxy bool)
- func SetSafecrlf(s *Buffer)
- func Slice(s interface{}) []byte
- func SlicesIndex(slice any, item any) int
- func SlicesInsert(slice any, index int, value any) any
- func SplitFileByLines(filePath string, size int)
- func Struct(s interface{}) []byte
- func ToCamel(data string, hasComment bool) string
- func ToCamelToLower(s string, hasComment bool) string
- func ToCamelUpper(s string, hasComment bool) string
- func ToLines[T string | []byte | *os.File | *bytes.Buffer](data T) (lines []string)
- func TopologicalSort[T comparable](m *safemap.M[T, []T], allowCyclicDependency bool) (sorted []T)
- func TrimExtension(path string) string
- func TrimSlash(name string) string
- func Uint32(s []uint32) []byte
- 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 ValueIsBytesType(v reflect.Value) bool
- 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 Buffer
- func (b *Buffer) Append(others ...*Buffer) *Buffer
- func (b *Buffer) AppendByteSlice(bytesSlice ...[]byte) []byte
- func (b *Buffer) AppendHeader(buf []byte) *Buffer
- 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) Empty() bool
- 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) *Buffer
- func (b *Buffer) Join(sep string, size int) string
- func (b *Buffer) LinesToString(lines []string) string
- func (b *Buffer) NewLine() *Buffer
- func (b *Buffer) ObjectBegin()
- func (b *Buffer) ObjectEnd()
- func (b *Buffer) Peek(n int) []byte
- func (b *Buffer) Quote()
- func (b *Buffer) QuoteWith(s string) *Buffer
- func (b *Buffer) ReWriteSelf()
- func (b *Buffer) ReWriteSelfGo()
- func (b *Buffer) ReadBinary(order binary.ByteOrder) (data any)
- func (b *Buffer) ReadN(n int) []byte
- func (b *Buffer) ReaderGzip() *Buffer
- func (b *Buffer) Replace(old, new string, n int) *Buffer
- func (b *Buffer) ReplaceAll(old, new string) *Buffer
- func (b *Buffer) ReplaceLine(index int, line string) *Buffer
- func (b *Buffer) Reverse() *Buffer
- func (b *Buffer) SliceBegin()
- func (b *Buffer) SliceEnd()
- func (b *Buffer) ToLines() (lines []string)
- func (b *Buffer) TrimPrefix(prefix string) *Buffer
- func (b *Buffer) TrimSpace() *Buffer
- func (b *Buffer) TrimSuffix(suffix string) *Buffer
- 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 Complex
- type Float
- type GeneratedFile
- func (g *GeneratedFile) EnumTypes(name string, TypeTooltipMap *safemap.M[string, string])
- func (g *GeneratedFile) Format() string
- func (g *GeneratedFile) P(v ...any)
- func (g *GeneratedFile) PC(is64Bit bool, v string)
- func (g *GeneratedFile) ReadTemplates(path, pkg string)
- func (g *GeneratedFile) SetCallBack(callBack func(is bool, v string) string)
- func (g *GeneratedFile) SetEnumBase(base int) *GeneratedFile
- func (g *GeneratedFile) SetEnumType(t reflect.Type) *GeneratedFile
- func (g *GeneratedFile) SetFilePath(filePath string) *GeneratedFile
- func (g *GeneratedFile) SetKeepOrigName(keepOrigName bool) *GeneratedFile
- func (g *GeneratedFile) SetPackageName(packageName string) *GeneratedFile
- func (g *GeneratedFile) SetValues(values []uint32) *GeneratedFile
- type HexDumpString
- type HexString
- type Integer
- type Ordered
- type Pool
- type Signed
- type Type
- type Unsigned
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)))`) 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 Bool2Integer ¶ added in v0.0.87
func ConvertUtf82Gbk ¶
func CreatDirectory ¶
func CurrentDirName ¶
func FileServer ¶ added in v0.0.17
func FileServer()
func FileServerFS ¶ added in v0.0.17
func FixFilePath ¶ added in v0.0.58
func Float64ToString ¶
func FormatDuration ¶
func FormatInteger ¶ added in v0.0.87
func FormatIntegerHex ¶ added in v0.0.87
func FormatIntegerHex0x ¶ added in v0.0.87
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 Integer2Bool ¶ added in v0.0.87
func IntegerToIP ¶
func IsASCIIAlpha ¶ added in v0.0.87
func IsASCIIDigit ¶ added in v0.0.87
func IsAlphanumeric ¶ added in v0.0.87
func IsDragonfly ¶
func IsDragonfly() bool
func IsFilePath ¶
func IsFilePathEx ¶ added in v0.0.23
func IsIncludeLine ¶ added in v0.0.87
func IsPortAvailable ¶ added in v0.0.87
IsPortAvailable 判断端口是否可以(未被占用)
func JoinHomeDir ¶
func JoinHomeFile ¶
func JsonIndent ¶
func MarshalJSON ¶
func MarshalJsonToFile ¶
func NewVersion ¶
func ParseFloat ¶
func Permute ¶ added in v0.0.87
func Permute[T comparable](data []T) [][]T
Permute 递归回溯法实现全排列 https://www.cnblogs.com/xwxz/p/14812448.html
func PermuteToUint32Slice ¶ added in v0.0.87
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 Slice ¶ added in v0.0.84
func Slice(s interface{}) []byte
Slice returns a byte slice view of a slice.
func SlicesIndex ¶
func SplitFileByLines ¶
func Struct ¶ added in v0.0.84
func Struct(s interface{}) []byte
Struct returns a byte slice view of a struct.
func ToCamelToLower ¶
func ToCamelUpper ¶
func TopologicalSort ¶ added in v0.0.87
func TopologicalSort[T comparable](m *safemap.M[T, []T], allowCyclicDependency bool) (sorted []T)
func TrimExtension ¶
func UnFormatDuration ¶
func UnFormatTime ¶
func UpdateModsByWorkSpace ¶
func ValueIsBytesType ¶ added in v0.0.87
func WriteAppend ¶
func WriteBinaryFile ¶
func WriteGoFile ¶
func WriteLines ¶
func WriteTruncate ¶
Types ¶
type Buffer ¶
全排列 矩阵置换 拓扑排序 N叉树 treeGrid
func NewHexDump ¶
func NewHexDump(hexdumpStr HexDumpString) (data *Buffer)
func NewHexString ¶
func ReaderGzip ¶
func SwapAdjacent ¶ added in v0.0.87
func (*Buffer) AppendByteSlice ¶
func (*Buffer) AppendHeader ¶ added in v0.0.87
AppendHeader InsertToStart
func (*Buffer) BigNumXorWithAlign ¶
func (*Buffer) CheckDesBlockSize ¶
func (b *Buffer) CheckDesBlockSize()
func (*Buffer) CutWithIndex ¶
func (*Buffer) HexStringUpper ¶
func (*Buffer) InsertByte ¶
func (*Buffer) InsertRune ¶
func (*Buffer) LinesToString ¶
func (*Buffer) ObjectBegin ¶
func (b *Buffer) ObjectBegin()
func (*Buffer) ReWriteSelf ¶ added in v0.0.87
func (b *Buffer) ReWriteSelf()
func (*Buffer) ReWriteSelfGo ¶ added in v0.0.87
func (b *Buffer) ReWriteSelfGo()
func (*Buffer) ReaderGzip ¶
func (*Buffer) ReplaceAll ¶
func (*Buffer) ReplaceLine ¶ added in v0.0.71
func (*Buffer) SliceBegin ¶
func (b *Buffer) SliceBegin()
func (*Buffer) TrimPrefix ¶ added in v0.0.66
func (*Buffer) TrimSuffix ¶ added in v0.0.66
func (*Buffer) WriteBytesLn ¶
func (*Buffer) WritePackageName ¶
func (b *Buffer) WritePackageName()
func (*Buffer) WriteStringLn ¶
type CommandSession ¶ added in v0.0.16
func RunCommand ¶
func RunCommand(command string) (session *CommandSession)
func RunCommandArgs ¶ added in v0.0.16
func RunCommandArgs(arg ...string) *CommandSession
type Complex ¶ added in v0.0.87
type Complex interface {
~complex64 | ~complex128
}
type GeneratedFile ¶
type GeneratedFile struct {
*Buffer
// contains filtered or unexported fields
}
func NewGeneratedFile ¶ added in v0.0.58
func NewGeneratedFile() (g *GeneratedFile)
func (*GeneratedFile) Format ¶ added in v0.0.87
func (g *GeneratedFile) Format() string
func (*GeneratedFile) P ¶
func (g *GeneratedFile) P(v ...any)
func (*GeneratedFile) PC ¶ added in v0.0.87
func (g *GeneratedFile) PC(is64Bit bool, v string)
func (*GeneratedFile) ReadTemplates ¶
func (g *GeneratedFile) ReadTemplates(path, pkg string)
func (*GeneratedFile) SetCallBack ¶ added in v0.0.87
func (g *GeneratedFile) SetCallBack(callBack func(is bool, v string) string)
func (*GeneratedFile) SetEnumBase ¶ added in v0.0.87
func (g *GeneratedFile) SetEnumBase(base int) *GeneratedFile
func (*GeneratedFile) SetEnumType ¶ added in v0.0.87
func (g *GeneratedFile) SetEnumType(t reflect.Type) *GeneratedFile
func (*GeneratedFile) SetFilePath ¶ added in v0.0.83
func (g *GeneratedFile) SetFilePath(filePath string) *GeneratedFile
func (*GeneratedFile) SetKeepOrigName ¶ added in v0.0.87
func (g *GeneratedFile) SetKeepOrigName(keepOrigName bool) *GeneratedFile
func (*GeneratedFile) SetPackageName ¶ added in v0.0.83
func (g *GeneratedFile) SetPackageName(packageName string) *GeneratedFile
func (*GeneratedFile) SetValues ¶ added in v0.0.87
func (g *GeneratedFile) SetValues(values []uint32) *GeneratedFile
type HexDumpString ¶
type HexDumpString string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.