Documentation
¶
Index ¶
- func BackgroundCronExecuteWithInterval(execution func(), duration time.Duration, done <-chan struct{})
- func ExecCommand(command string, timeout ...int) (string, error)
- func ForegroundCronExecuteWithInterval(execution func(), duration time.Duration)
- func GetCurrentTime() string
- func GetCurrentTimestamp() int64
- func GinErrorResponse(c *gin.Context, message string)
- func GinSuccessResponse(c *gin.Context, data interface{})
- func GinValidateToken(expectedToken string) gin.HandlerFunc
- func Md5File(filename string) (string, error)
- func Md5Str(s string) (res string, err error)
- func NewMail(config *NewMailConfig) *mailer
- func PrintBlueMessage(message string)
- func PrintGreenMessage(message string)
- func PrintRedMessage(message string)
- func PrintYellowMessage(message string)
- func RunPrompt[T any](label string, items []T) (string, error)
- func SendQwMarkdownMessage(token string, markdownContent string) error
- func SyncOne()
- type CustomeResponse
- type NewMailConfig
- type RequestGetOptions
- type RequestPostOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackgroundCronExecuteWithInterval ¶ added in v1.1.8
func BackgroundCronExecuteWithInterval(execution func(), duration time.Duration, done <-chan struct{})
BackgroundCronExecuteWithInterval 启动后台执行函数,每隔 duration 执行一次,并在后台独立运行,不阻塞主进程
func ExecCommand ¶
ExecCommand 执行shell命令 command 为要执行的命令 timeout 为超时时间
func ForegroundCronExecuteWithInterval ¶ added in v1.1.8
ForegroundCronExecuteWithInterval 执行函数,并每隔 duration 执行一次,阻塞进程执行
func GinErrorResponse ¶ added in v1.1.12
ErrorResponse 用于创建错误响应
func GinSuccessResponse ¶ added in v1.1.12
SuccessResponse 用于创建成功响应
func GinValidateToken ¶ added in v1.1.12
func GinValidateToken(expectedToken string) gin.HandlerFunc
GinValidateToken 中间件:验证请求头token
func NewMail ¶
func NewMail(config *NewMailConfig) *mailer
func PrintBlueMessage ¶ added in v1.1.3
func PrintBlueMessage(message string)
func PrintGreenMessage ¶ added in v1.1.3
func PrintGreenMessage(message string)
func PrintRedMessage ¶ added in v1.1.3
func PrintRedMessage(message string)
func PrintYellowMessage ¶ added in v1.1.3
func PrintYellowMessage(message string)
func SendQwMarkdownMessage ¶ added in v1.1.7
SendMarkdownMessage 发送企业微信 Markdown 消息
Types ¶
type CustomeResponse ¶ added in v1.1.11
type CustomeResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
Content any `json:"content"`
}
func RequestGet ¶ added in v1.1.9
func RequestGet(options *RequestGetOptions) (res CustomeResponse, err error)
func RequestPost ¶ added in v1.1.9
func RequestPost(options *RequestPostOptions) (res CustomeResponse, err error)
RequestPost 函数用于发送POST请求
type NewMailConfig ¶ added in v1.1.6
type RequestGetOptions ¶
Click to show internal directories.
Click to hide internal directories.