Documentation
¶
Index ¶
- Constants
- Variables
- func AlignString(s string, length int) (ss string)
- func BaseName(path string) string
- func Bool2Integer[T Integer](b bool) T
- func Call(f func())
- func ChdirToGithubWorkspace()
- func Check[T any](result T) (isEof bool)
- func Check2[T any](ret T, err error) T
- func Check2Bool[T any](ret T, ok bool) T
- func Check2ForJsonNumberNodeType[T any](ret T, err error) bool
- func Check2Ignore[T any](ret T, err error) T
- func Check3[T1 any, T2 any](ret1 T1, ret2 T2, err error) (T1, T2)
- func Check3Bool[T1 any, T2 any](ret1 T1, ret2 T2, ok bool) (T1, T2)
- func Check4[T1 any, T2 any, T3 any](ret1 T1, ret2 T2, ret3 T3, err error) (T1, T2, T3)
- func Check4Bool[T1 any, T2 any, T3 any](ret1 T1, ret2 T2, ret3 T3, ok bool) (T1, T2, T3)
- func Check5[T1 any, T2 any, T3 any, T4 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, err error) (T1, T2, T3, T4)
- func Check5Bool[T1 any, T2 any, T3 any, T4 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, ok bool) (T1, T2, T3, T4)
- func Check6[T1 any, T2 any, T3 any, T4 any, T5 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, ret5 T5, err error) (T1, T2, T3, T4, T5)
- func Check6Bool[T1 any, T2 any, T3 any, T4 any, T5 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, ret5 T5, ok bool) (T1, T2, T3, T4, T5)
- func Check7[T1 any, T2 any, T3 any, T4 any, T5 any, T6 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, ret5 T5, ret6 T6, err error) (T1, T2, T3, T4, T5, T6)
- func Check7Bool[T1 any, T2 any, T3 any, T4 any, T5 any, T6 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, ret5 T5, ret6 T6, ok bool) (T1, T2, T3, T4, T5, T6)
- func CheckIgnore(err any)
- func CheckNil(ptr any)
- func Concat[S ~[]E, E any](slices_ ...S) S
- func Copy(src, dst string)
- func CopyDir(dst, src string)
- func CopyFile(path, dstPath string)
- func CopyWithMask(src, dst string, mask fs.FileMode)
- 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 DumpRequest(req *http.Request, body bool) string
- func DumpResponse(resp *http.Response, body bool) string
- func FileExists(path string) bool
- func FileLineCountIsMoreThan(path string, n int) bool
- func FixFilePath(path string) string
- func FormatAllFiles(noComments bool, path 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 GenA2Z() (letters []string)
- func GenMask()
- func GetDiffDays(dstTime string) string
- func GetLastReturnType(assignStmt *ast.AssignStmt) (lastReturnType string, b bool)
- 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 Hex[K keyType, V Unsigned](title K, v V) string
- func HexDump[K keyType, V []byte | *bytes.Buffer](title K, buf V)
- func HomeDir() string
- func Info[K keyType](title K, msg ...any)
- func Integer2Bool[T Integer](value T) bool
- func IntegerToIP(ip int64) string
- func IsASCIIDigit(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 IsFilePath(path string) bool
- func IsFilePathEx(path string) (ok bool)
- func IsFreebsd() bool
- func IsIncludeLine(s string) bool
- func IsIos() bool
- func IsJs() bool
- func IsLinux() bool
- func IsTermux() bool
- func IsWindows() bool
- func IsZero(v reflect.Value) bool
- func JoinHomeDir(path string) (join string)
- func JoinHomeFile(path string) (join string)
- func Json[K keyType](title K, msg ...any)
- func JsonIndent(b []byte) string
- func Lines(s string) iter.Seq2[int, string]
- func LinesBytes(s []byte) iter.Seq2[int, []byte]
- func MarshalJSON(v any) []byte
- func MarshalJson[K keyType](title K, msg any)
- func MarshalJsonToFile(v any, name string)
- func MoveFile(src, dst string)
- func New() *log
- func RandomAny[T any](slice []T) T
- func ReadFileToChunks(path string, n int) iter.Seq[[]byte]
- func ReadFileToLines(path string) iter.Seq[string]
- func ReflectVisibleFields(object any) []reflect.StructField
- func RegexpWebBodyBlocks(tagName string) string
- func Request(Request *http.Request, body bool)
- func Response(Response *http.Response, body bool)
- func Row() string
- func RunDir() string
- func SetCallBack(callBack func())
- func SetDebug(debug bool)
- func Struct(object any)
- func Success[K keyType](title K, msg ...any)
- func Todo(body string)
- func Trace[K keyType](title K, msg ...any)
- func TrimExtension(path string) string
- func UnFormatDuration(s string) time.Duration
- func UnFormatTime(s string) time.Time
- func ValueIsBytesType(v reflect.Value) bool
- func Warning[K keyType](title K, msg ...any)
- 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 WriteGoFileWithDiff[T []byte](path string, data T)
- 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) BigNumXorWithAlign(arg1, arg2 []byte, align int) []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)
- func (b *Buffer) InsertHeader(buf []byte) *Buffer
- func (b *Buffer) InsertString(index int, s string) *Buffer
- func (b *Buffer) Join(sep string, size int) 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) Reverse() *Buffer
- func (b *Buffer) SliceBegin()
- func (b *Buffer) SliceEnd()
- func (b *Buffer) ToLines() (lines iter.Seq[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 Complex
- type Float
- type HexDumpString
- type HexString
- type Integer
- type Ordered
- type Signed
- type Type
- type Unsigned
Constants ¶
const ( FgHiBlack attribute = iota + 90 FgHiRed FgHiGreen FgHiYellow FgHiBlue FgHiMagenta FgHiCyan FgHiWhite )
Foreground Hi-Intensity text colors
const TimeLayout = "2006-01-02 15:04:05"
Variables ¶
var ( GithubWorkspace = os.Getenv("GITHUB_WORKSPACE") IsAction = GithubWorkspace != "" )
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]+)`) )
var RegexpCenter = `(.+?)`
var RuntimePrefixesToFilter = []string{
"runtime.",
"testing.",
"github.com/ddkwork/golibrary/mylog.callWithHandler",
"github.com/ddkwork/golibrary/mylog.Call",
}
var Skips = []string{
`vendor`,
`\gioview\`,
`\gio\`,
`\gio-cmd\`,
`\gio-example\`,
`\gio-x\`,
`\toolbox\`,
`\unison\`,
`\ux\patch\`,
}
Functions ¶
func AlignString ¶ added in v0.0.56
func Bool2Integer ¶ added in v0.0.87
func ChdirToGithubWorkspace ¶ added in v0.0.87
func ChdirToGithubWorkspace()
func Check2Bool ¶ added in v0.0.6
func Check2ForJsonNumberNodeType ¶ added in v0.0.87
func Check2Ignore ¶ added in v0.0.6
func Check3Bool ¶ added in v0.0.6
func Check4Bool ¶ added in v0.0.6
func Check5Bool ¶ added in v0.0.6
func Check6Bool ¶ added in v0.0.6
func Check7Bool ¶ added in v0.0.7
func CheckIgnore ¶ added in v0.0.8
func CheckIgnore(err any)
func Copy ¶ added in v0.0.91
func Copy(src, dst string)
Copy src to dst. src may be a directory, file, or symlink.
func CopyWithMask ¶ added in v0.0.91
CopyWithMask src to dst. src may be a directory, file, or symlink.
func CreatDirectory ¶ added in v0.0.23
func CurrentDirName ¶ added in v0.0.56
func FileExists ¶ added in v0.0.91
FileExists returns true if the path points to a regular file.
func FileLineCountIsMoreThan ¶ added in v0.0.91
func FixFilePath ¶ added in v0.0.58
func FormatAllFiles ¶ added in v0.0.53
func FormatDuration ¶ added in v0.0.56
func FormatInteger ¶ added in v0.0.87
func FormatIntegerHex ¶ added in v0.0.87
func FormatIntegerHex0x ¶ added in v0.0.87
func FormatTime ¶ added in v0.0.56
func GetDiffDays ¶ added in v0.0.56
func GetLastReturnType ¶ added in v0.0.31
func GetLastReturnType(assignStmt *ast.AssignStmt) (lastReturnType string, b bool)
func GetPackageName ¶ added in v0.0.56
func GetPackageName() (pkgName string)
func GetTimeNowString ¶ added in v0.0.56
func GetTimeNowString() string
func GetTimeStamp ¶ added in v0.0.56
func GetTimeStamp() string
func GetTimeStamp13Bits ¶ added in v0.0.56
func GetTimeStamp13Bits() int64
func GetUserConfigDirs ¶ added in v0.0.56
func GetWindowsLogicalDrives ¶ added in v0.0.56
func GetWindowsLogicalDrives() []string
func Integer2Bool ¶ added in v0.0.87
func IntegerToIP ¶ added in v0.0.56
func IsASCIIDigit ¶ added in v0.0.87
func IsFilePath ¶ added in v0.0.56
func IsFilePathEx ¶ added in v0.0.56
func IsIncludeLine ¶ added in v0.0.87
func JoinHomeDir ¶ added in v0.0.56
func JoinHomeFile ¶ added in v0.0.56
func JsonIndent ¶ added in v0.0.56
func Lines ¶ added in v0.0.56
Lines returns an iterator over the newline-terminated lines in the string s. The lines yielded by the iterator include their terminating newlines. If s is empty, the iterator yields no lines at all. If s does not end in a newline, the final yielded line will not end in a newline. It returns a single-use iterator with both line number and line content.
func LinesBytes ¶ added in v0.0.91
LinesBytes returns an iterator over the newline-terminated lines in the byte slice s. The lines yielded by the iterator include their terminating newlines. If s is empty, the iterator yields no lines at all. If s does not end in a newline, the final yielded line will not end in a newline. It returns a single-use iterator.
func MarshalJSON ¶ added in v0.0.56
func MarshalJson ¶
func MarshalJson[K keyType](title K, msg any)
func MarshalJsonToFile ¶ added in v0.0.56
func MoveFile ¶ added in v0.0.56
func MoveFile(src, dst string)
MoveFile moves a file in the file system or across volumes, using rename if possible, but falling back to copying the file if not. This will error if either src or dst are not regular files.
func ReflectVisibleFields ¶ added in v0.0.56
func ReflectVisibleFields(object any) []reflect.StructField
func RegexpWebBodyBlocks ¶ added in v0.0.56
func SetCallBack ¶ added in v0.0.87
func SetCallBack(callBack func())
func TrimExtension ¶ added in v0.0.56
func UnFormatDuration ¶ added in v0.0.56
func UnFormatTime ¶ added in v0.0.56
func ValueIsBytesType ¶ added in v0.0.87
func WriteAppend ¶ added in v0.0.56
func WriteBinaryFile ¶ added in v0.0.56
func WriteGoFile ¶ added in v0.0.56
func WriteGoFileWithDiff ¶ added in v0.0.23
func WriteTruncate ¶ added in v0.0.56
Types ¶
type Buffer ¶ added in v0.0.56
全排列 矩阵置换 拓扑排序 N叉树 treeGrid
func NewHexDump ¶ added in v0.0.56
func NewHexDump(hexdumpStr HexDumpString) (data *Buffer)
func NewHexString ¶ added in v0.0.56
func ReaderGzip ¶ added in v0.0.56
func SwapAdjacent ¶ added in v0.0.87
func (*Buffer) AppendByteSlice ¶ added in v0.0.56
func (*Buffer) BigNumXorWithAlign ¶ added in v0.0.56
func (*Buffer) CheckDesBlockSize ¶ added in v0.0.56
func (b *Buffer) CheckDesBlockSize()
func (*Buffer) CutWithIndex ¶ added in v0.0.56
func (*Buffer) HexStringUpper ¶ added in v0.0.56
func (*Buffer) InsertByte ¶ added in v0.0.56
func (*Buffer) InsertBytes ¶ added in v0.0.56
func (*Buffer) InsertHeader ¶ added in v0.0.91
InsertHeader insert to start,packetHeader
func (*Buffer) InsertString ¶ added in v0.0.56
func (*Buffer) ObjectBegin ¶ added in v0.0.56
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) ReadBinary ¶ added in v0.0.56
func (*Buffer) ReaderGzip ¶ added in v0.0.56
func (*Buffer) ReplaceAll ¶ added in v0.0.56
func (*Buffer) SliceBegin ¶ added in v0.0.56
func (b *Buffer) SliceBegin()
func (*Buffer) TrimPrefix ¶ added in v0.0.66
func (*Buffer) TrimSuffix ¶ added in v0.0.66
func (*Buffer) WriteBinary ¶ added in v0.0.56
func (*Buffer) WriteBytesLn ¶ added in v0.0.56
func (*Buffer) WritePackageName ¶ added in v0.0.56
func (b *Buffer) WritePackageName()
func (*Buffer) WriteStringLn ¶ added in v0.0.56
type Complex ¶ added in v0.0.87
type Complex interface {
~complex64 | ~complex128
}
type HexDumpString ¶ added in v0.0.56
type HexDumpString string