Documentation
¶
Index ¶
- Constants
- Variables
- func AlignString(s string, length int) (ss string)
- func Atoi(s string) int
- func BaseName(path string) string
- func Body() string
- func Call(f func())
- func Check[T any](result T)
- func Check2[T any](ret T, err error) (r1 T)
- func Check2Bool[T any](ret T, ok bool) (r1 T)
- func Check2Ignore[T any](ret T, err error) (r1 T)
- func Check3[T1 any, T2 any](ret1 T1, ret2 T2, err error) (r1 T1, r2 T2)
- func Check3Bool[T1 any, T2 any](ret1 T1, ret2 T2, ok bool) (r1 T1, r2 T2)
- func Check4[T1 any, T2 any, T3 any](ret1 T1, ret2 T2, ret3 T3, err error) (r1 T1, r2 T2, r3 T3)
- func Check4Bool[T1 any, T2 any, T3 any](ret1 T1, ret2 T2, ret3 T3, ok bool) (r1 T1, r2 T2, r3 T3)
- func Check5[T1 any, T2 any, T3 any, T4 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, err error) (r1 T1, r2 T2, r3 T3, r4 T4)
- func Check5Bool[T1 any, T2 any, T3 any, T4 any](ret1 T1, ret2 T2, ret3 T3, ret4 T4, ok bool) (r1 T1, r2 T2, r3 T3, r4 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) (r1 T1, r2 T2, r3 T3, r4 T4, r5 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) (r1 T1, r2 T2, r3 T3, r4 T4, r5 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) (r1 T1, r2 T2, r3 T3, r4 T4, r5 T5, r6 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) (r1 T1, r2 T2, r3 T3, r4 T4, r5 T5, r6 T6)
- func CheckEof[T any](result T) (isEof bool)
- func CheckIgnore(err any)
- func CheckNil(ptr any)
- func Concat[S ~[]E, E any](slices_ ...S) S
- 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 Diff(oldName string, old []byte, newName string, new []byte) []byte
- func DirDepth(dirPath string) (depth int)
- func DumpRequest(req *http.Request, body bool) string
- func DumpResponse(resp *http.Response, body bool) string
- func FixFilePath(path string) string
- func Float64Cut(value float64, bits int) (float64, error)
- func Float64ToString(f float64, prec int) string
- func FormatAllFiles()
- func FormatAllFilesNoComments()
- func FormatDuration(d time.Duration) string
- func FormatTime(t time.Time) string
- func GenA2Z() (letters []string)
- 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 Hex[T constraints.Integer | []byte | *bytes.Buffer](title string, msg T) string
- func HexDump(title string, b []byte)
- func HexInteger[T constraints.Integer](msg T) string
- func HomeDir() string
- func Info(title string, msg ...any)
- 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 Json(title string, msg ...any)
- func JsonIndent(b []byte) string
- func Lines(x []byte) []string
- func MarshalJSON(v any) []byte
- func MarshalJson(title string, msg any)
- func MarshalJsonToFile(v any, name string)
- func Message() string
- func MoveFile(src, dst string)
- func ParseFloat(sizeStr string) (size float64)
- func ParseInt(s string) int64
- func ParseUint(s string) uint64
- func RandomAny[T any](slice []T) T
- func ReadFileToLines(path string) (lines []string)
- func ReadLines(fullPath string) ([]string, error)
- func Reason() (reason 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 RunDir() string
- func SerialNumber(b string) string
- func SetDebug(debug bool)
- func SlicesIndex(slice any, item any) int
- func SlicesInsert(slice any, index int, value any) any
- func SplitFileByLines(filePath string, size int)
- func Struct(msg any)
- func SubStrRunes(s string, length int) string
- func Success(title string, msg ...any)
- 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 Todo(body string)
- func Trace(title string, msg ...any)
- func TrimExtension(path string) string
- func TruncateLogFile()
- func UnFormatDuration(s string) time.Duration
- func UnFormatTime(s string) time.Time
- func Warning(title string, 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 WriteLines(lines []string, fullPath string) error
- func WriteTruncate[T Type](name string, data T)
- 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 HexDumpString
- type HexString
- 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)))`) 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 RegexpCenter = `(.+?)`
View Source
var RuntimePrefixesToFilter = []string{
"runtime.",
"testing.",
"github.com/ddkwork/golibrary/mylog.callWithHandler",
"github.com/ddkwork/golibrary/mylog.Call",
}
Functions ¶
func AlignString ¶ added in v0.0.56
func Check2Bool ¶ added in v0.0.6
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 CreatDirectory ¶ added in v0.0.23
func CurrentDirName ¶ added in v0.0.56
func CutUint16_ ¶ added in v0.0.56
func FixFilePath ¶ added in v0.0.58
func Float64ToString ¶ added in v0.0.56
func FormatAllFiles ¶ added in v0.0.53
func FormatAllFiles()
func FormatAllFilesNoComments ¶ added in v0.0.53
func FormatAllFilesNoComments()
func FormatDuration ¶ added in v0.0.56
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 HexInteger ¶
func HexInteger[T constraints.Integer](msg T) string
func IntegerToIP ¶ added in v0.0.56
func IsDragonfly ¶ added in v0.0.56
func IsDragonfly() bool
func IsFilePath ¶ added in v0.0.56
func IsFilePathEx ¶ added in v0.0.56
func JoinHomeDir ¶ added in v0.0.56
func JoinHomeFile ¶ added in v0.0.56
func JsonIndent ¶ added in v0.0.56
func MarshalJSON ¶ added in v0.0.56
func MarshalJson ¶
func MarshalJsonToFile ¶ added in v0.0.56
func ParseFloat ¶ added in v0.0.56
func ReadFileToLines ¶ added in v0.0.56
func ReflectVisibleFields ¶ added in v0.0.56
func ReflectVisibleFields(object any) []reflect.StructField
func RegexpWebBodyBlocks ¶ added in v0.0.56
func SerialNumber ¶ added in v0.0.56
func SlicesIndex ¶ added in v0.0.56
func SplitFileByLines ¶ added in v0.0.56
func SubStrRunes ¶ added in v0.0.56
func SwapBytes2HexString2 ¶ added in v0.0.56
func ToCamelToLower ¶ added in v0.0.56
func ToCamelUpper ¶ added in v0.0.56
func TrimExtension ¶ added in v0.0.56
func TruncateLogFile ¶
func TruncateLogFile()
func UnFormatDuration ¶ added in v0.0.56
func UnFormatTime ¶ added in v0.0.56
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 WriteLines ¶ added in v0.0.56
func WriteTruncate ¶ added in v0.0.56
Types ¶
type Buffer ¶ added in v0.0.56
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 (*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) InsertRune ¶ added in v0.0.56
func (*Buffer) InsertString ¶ added in v0.0.56
func (*Buffer) InsertStringWithSplit ¶ added in v0.0.56
func (*Buffer) LinesToString ¶ added in v0.0.56
func (*Buffer) ObjectBegin ¶ added in v0.0.56
func (b *Buffer) ObjectBegin()
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) SplitBytes ¶ added in v0.0.56
func (*Buffer) SplitString ¶ added in v0.0.56
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 HexDumpString ¶ added in v0.0.56
type HexDumpString string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.