Documentation ¶
Index ¶
- Constants
- Variables
- func AlignString(s string, length int) (ss string)
- func ApplyFill(c *Config, sv *svg.SVG) error
- func Atoi(s string) int
- func BaseName(path string) string
- func Concat[S ~[]E, E any](slices_ ...S) S
- func CopyDir(source, destination string) (ok bool)
- func CreatDirectory(dir string) bool
- func CurrentDirName(path string) (currentDirName string)
- func CutUint16(u uint16) uint8
- func EmbedImage(c *Config) error
- func FileExists(path string) bool
- 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 GenXiLa26() (letters []string)
- func GenerateRandomNumber(max int) int
- func GetDiffDays(dstTime string) string
- func GetPackageName() (pkgName string)
- func GetTimeNowString() string
- func GetTimeStamp() string
- func GetTimeStamp13Bits() int64
- func GetUserConfigDirs() (UserConfigDirs map[string]string, err error)
- func GitProxy(isSetProxy bool) bool
- func HomeDir() string
- func Ico2Png(path string)
- func Ico2PngAll(dir string)
- func IntegerToIP(ip int64) string
- func IsAndroid() bool
- func IsDir(path string) bool
- func IsDirDeep1(path string) bool
- func IsLinux() bool
- func IsTermux() bool
- func IsWindows() bool
- func IsZero(v reflect.Value) bool
- func JoinHomeDir(path string) (join string, ok bool)
- func JoinHomeFile(path string) (join string, ok bool)
- func Lines(x []byte) []string
- func MoveFile(src, dst string) (err error)
- func NewVersion[T string | uint64](s ...T) (v *object)
- func ParseFloat(s string) float64
- func ParseInt(s string) int64
- func ParseUint(s string) uint64
- func Png2Svg(path string)
- func Png2SvgAll(dir string)
- func RandomNum(min, max int) int
- func ReadFileAndWriteTruncate(path, dstPath string) (ok bool)
- func ReadFileSubTimeWithCallBack(title, path string, callBack func(string))
- func ReadFileToLines(path string) (lines []string, ok bool)
- func ReaderGzip[T safeType.Type](data T) *safeType.Data
- func RegexpWebBodyBlocks(tagName string) string
- func Render(c *Config) error
- func RunDir() string
- func RunDirAbs() string
- func SetNameAndEmail(s *Stream)
- func SetProxy(s *Stream, isSetProxy bool)
- func SetSafecrlf(s *Stream)
- 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 SwapBytes2HexString(src []byte) (dst safeType.HexString)
- func SwapBytes2HexString2(src safeType.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 TrimExtension(path string) string
- func UnFormatDuration(s string) time.Duration
- func UnFormatTime(s string) time.Time
- func Utf82Gbk(utf8 string) (gbk string)
- func WriteAppend[T safeType.Type](name string, data T) bool
- func WriteBinaryFile[T safeType.Type](name string, data T) bool
- func WriteGoFile[T safeType.Type](name string, data T) (ok bool)
- func WriteTruncate[T safeType.Type](name string, data T) bool
- type Config
- type RenderConfig
- type Stream
- func (o *Stream) AppendByteSlice(bytesSlice ...[]byte) []byte
- func (o *Stream) BigNumXorWithAlign(arg1, arg2 []byte, align int) (xorStream []byte)
- func (o *Stream) CheckDesBlockSize() bool
- func (o *Stream) Contains(substr string) bool
- func (o *Stream) CutString(left, right string) (cut string, found bool)
- func (o *Stream) CutUint16(u uint16) uint8
- func (o *Stream) CutWithIndex(x, y int) []byte
- func (o *Stream) Indent(deep int)
- func (o *Stream) InsertByte(index int, ch byte)
- func (o *Stream) InsertBytes(index int, insert []byte) []byte
- func (o *Stream) InsertRune(index int, r rune)
- func (o *Stream) InsertString(index int, s string) string
- func (o *Stream) InsertStringWithSplit(size int, insert string) string
- func (o *Stream) JsonIndent() string
- func (o *Stream) LinesToString(lines []string) string
- func (o *Stream) MergeByte(streams ...[]byte) []byte
- func (o *Stream) NewLine() *Stream
- func (o *Stream) ObjectBegin()
- func (o *Stream) ObjectEnd()
- func (o *Stream) Quote()
- func (o *Stream) QuoteWith(s string) *Stream
- func (o *Stream) ReadBinary(order binary.ByteOrder) (data any)
- func (o *Stream) ReaderGzip() *Stream
- func (o *Stream) ReplaceAll(old, new string) *Stream
- func (o *Stream) SerialNumber() string
- func (o *Stream) SliceBegin()
- func (o *Stream) SliceEnd()
- func (o *Stream) SplitBytes(size int) (blocks [][]byte)
- func (o *Stream) SplitString(size int) (blocks []string)
- func (o *Stream) ToLines() (lines []string, ok bool)
- func (o *Stream) WriteBinary(order binary.ByteOrder, data any) bool
- func (o *Stream) WriteBytesLn(b []byte) *Stream
- func (o *Stream) WritePackageName()
- func (o *Stream) WriteStringLn(s string) *Stream
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 RegexpCenter = `(.+?)`
Functions ¶
func AlignString ¶
func CreatDirectory ¶
func CurrentDirName ¶
func EmbedImage ¶
EmbedImage embeds the input image file into the output svg file.
func FileExists ¶
func FixUncPath ¶
func Float64ToString ¶
func FormatDuration ¶
func FormatTime ¶
func GenerateRandomNumber ¶
func GetDiffDays ¶
func GetPackageName ¶
func GetPackageName() (pkgName string)
func GetTimeNowString ¶
func GetTimeNowString() string
func GetTimeStamp ¶
func GetTimeStamp() string
func GetTimeStamp13Bits ¶
func GetTimeStamp13Bits() int64
func GetUserConfigDirs ¶
func IntegerToIP ¶
func JoinHomeDir ¶
func JoinHomeFile ¶
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 NewVersion ¶
func ParseFloat ¶
func Png2SvgAll ¶
func Png2SvgAll(dir string)
func ReadFileToLines ¶
func RegexpWebBodyBlocks ¶
func SetNameAndEmail ¶
func SetNameAndEmail(s *Stream)
func SetSafecrlf ¶
func SetSafecrlf(s *Stream)
func SlicesIndex ¶
func SubStrRunes ¶
func SwapBytes2HexString ¶
func SwapBytes2HexString2 ¶
SwapBytes2HexString2 逆序,并不是交换 todo 重命名为 Reverse,如果输入参数复合8字节以下的字节对齐可以用二进制包,不过不通用
func ToCamelToLower ¶
func ToCamelUpper ¶
func TrimExtension ¶
func UnFormatDuration ¶
func UnFormatTime ¶
Types ¶
type Config ¶
type Config struct { // Input is the filename of the input file Input string `posarg:"0"` // Output is the filename of the output file. // Defaults to input with the extension changed to the output format. Output string `flag:"o,output"` // Fill, if specified, indicates to fill the background of // the svg with the specified color in CSS format. Fill string Render RenderConfig `cmd:"render"` }
type RenderConfig ¶
type Stream ¶
func NewBinaryType ¶
func NewBinaryType[T safeType.BinaryType](b T) *Stream
func NewHexDump ¶
func NewHexDump(h safeType.HexDumpString) *Stream
func NewHexString ¶
func NewReadFile ¶
func (*Stream) AppendByteSlice ¶
func (*Stream) BigNumXorWithAlign ¶
func (*Stream) CheckDesBlockSize ¶
func (*Stream) CutWithIndex ¶
func (*Stream) InsertByte ¶
func (*Stream) InsertRune ¶
func (*Stream) InsertStringWithSplit ¶
func (*Stream) JsonIndent ¶
func (*Stream) LinesToString ¶
func (*Stream) ObjectBegin ¶
func (o *Stream) ObjectBegin()
func (*Stream) ReaderGzip ¶
func (*Stream) ReplaceAll ¶
func (*Stream) SerialNumber ¶
SerialNumber 这个才是swap功能,前后字节交换顺序
func (*Stream) SliceBegin ¶
func (o *Stream) SliceBegin()
func (*Stream) SplitBytes ¶
func (*Stream) SplitString ¶
func (*Stream) WriteBytesLn ¶
func (*Stream) WritePackageName ¶
func (o *Stream) WritePackageName()
func (*Stream) WriteStringLn ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
net
|
|
httpClient
<nilaway struct enable>
|
<nilaway struct enable> |
script
|
|
desktop
Package desktop provides desktop integration utilities.
|
Package desktop provides desktop integration utilities. |
errs
Package errs implements a detailed error object that provides stack traces with source locations, along with nested causes, if any.
|
Package errs implements a detailed error object that provides stack traces with source locations, along with nested causes, if any. |
taskqueue
Package taskqueue provides a simple asynchronous task queue.
|
Package taskqueue provides a simple asynchronous task queue. |
txt
Package txt provides various text utilities.
|
Package txt provides various text utilities. |
tui
|
|
Click to show internal directories.
Click to hide internal directories.