Documentation
¶
Index ¶
- Constants
- func AddDuration(t time.Time, duration string) (time.Time, error)
- func BackgroundExecuteWithInterval(execution func(), duration time.Duration, done <-chan struct{})
- func BlueMessage(message string)
- func Close(db *gorm.DB)
- func ExecCommand(command string, timeout ...int) (string, error)
- func Exists(pathname string) bool
- func FileMd5(filename string) (string, error)
- func ForegroundExecuteWithInterval(execution func(), duration time.Duration)
- func FormatTimestamp(ts int64, layout string) string
- func GetCurrentMilliTimestamp() int64
- func GetCurrentTime() string
- func GetCurrentTimestamp() int64
- func GreenMessage(message string)
- func IsDir(pathname string) bool
- func Message(message string, optionalParams ...string)
- func MkDir(dirname string) error
- func MkDirIfNotExists(dirname string) error
- func New(dsn string) *gorm.DB
- func NewMail(host, user, password string, port int, smtpSSL bool) *mailer
- func ParseTime(value string) (time.Time, error)
- func ParseTimeWithFormat(value, layout string) (time.Time, error)
- func ReadFile(pathname string) []byte
- func RedMessage(message string)
- func Remove(pathname string) error
- func RunPrompt[T any](label string, items []T) (string, error)
- func SendMarkdownMessage(token string, content string) error
- func StandardFormat(ts int64) string
- func StrMd5(s string) (res string, err error)
- func SubtractTimes(t1, t2 time.Time) time.Duration
- func SyncOne()
- func YellowMessage(message string)
- type RequestGetOptions
- type RequestPostOptions
- type Response
Constants ¶
View Source
const ( STANDARD_FORMAT = "2006-01-02 15:04:05" DATE_FORMAT = "2006-01-02" MONTH_FORMAT = "2006-01" FLAT_DATE = "20060102" FLAT_FORMAT = "20060102150405" )
常量:时间格式
Variables ¶
This section is empty.
Functions ¶
func AddDuration ¶
AddDuration 给指定时间增加指定的时间间隔
func BackgroundExecuteWithInterval ¶
BackgroundExecuteWithInterval 启动后台执行函数,每隔 duration 执行一次,并在后台独立运行,不阻塞主进程
func BlueMessage ¶
func BlueMessage(message string)
func ExecCommand ¶
ExecCommand 执行shell命令 command 为要执行的命令 timeout 为超时时间
func ForegroundExecuteWithInterval ¶
ForegroundExecuteWithInterval 执行函数,并每隔 duration 执行一次,阻塞进程执行
func FormatTimestamp ¶
FormatTimestamp 格式化时间戳为指定格式
func GetCurrentMilliTimestamp ¶
func GetCurrentMilliTimestamp() int64
GetCurrentMilliTimestamp 获取当前时间戳(毫秒级)
func GreenMessage ¶
func GreenMessage(message string)
func ParseTimeWithFormat ¶
ParseTimeWithFormat 按指定格式解析时间字符串
func RedMessage ¶
func RedMessage(message string)
func SendMarkdownMessage ¶
func YellowMessage ¶
func YellowMessage(message string)
Types ¶
type RequestGetOptions ¶
Click to show internal directories.
Click to hide internal directories.