util

package module
v0.0.0-...-60bd66e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

README

util

import

go get github.com/13inary/util

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertModel

func ConvertModel(srcModel any, dstModelPointer any) error

ConvertModel 源模型的字段会覆盖目标模型的字段。注意转换多个源到目的模型时多个源的字段相同问题。

func Float2String

func Float2String(f float64, suffix string) string

func InitTimezone

func InitTimezone()

func Int2String

func Int2String(i int, suffix string) string

func LoopExecute

func LoopExecute(ctx context.Context, job func() error, interval time.Duration) error

LoopExecute 2次逻辑执行相隔的时间为:逻辑的执行时间 + 间隔时间

func StrTerminalLen

func StrTerminalLen(str string) int

StrTerminalLen 获取字符串在终端中输出的长度 例子: 中文 => 4 en => 2

func TableStr

func TableStr(lines [][]string, colMaxWidth []int) string

TableStr 获取可以展示表格的字符串 当 colMaxWidth 为nil,花费时间来自动计算

func TextBlue

func TextBlue(src string) string

func TextGreen

func TextGreen(src string) string

func TextPurple

func TextPurple(src string) string

func TextRed

func TextRed(src string) string

func TextYellow

func TextYellow(src string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL