webutils

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 14 Imported by: 0

README

webutils

网络请求相关的工具类

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeFmtMS = "2006-01-02 15:04:05.000"
	TimeFmt   = "2006-01-02 15:04:05"
)

Functions

func CookieToMap

func CookieToMap(cookie string) map[string]string

func CreateLog

func CreateLog(logfile string) *zap.SugaredLogger

func GetNextMinuteMs

func GetNextMinuteMs(aheadMs int) (time.Duration, time.Duration, error)

func GetWaiMaiSeverTime

func GetWaiMaiSeverTime() (timestamp int64, err error)

func RandomEmoji added in v1.1.0

func RandomEmoji() string

func RandomUA

func RandomUA() string

func WaitToSecond

func WaitToSecond(targetSecond int, aheadMs int) time.Duration

Types

type Coupon

type Coupon struct {
	Id           string  `json:"id"`
	MerchantName string  `json:"merchantName"`
	Money        float64 `json:"money"`
}

type GlobalOption

type GlobalOption struct {
	// 发包总数
	Count int
	// 发包间隔
	Interval int

	// 提前毫秒数,微调使用
	AheadMs int

	// 推送方式
	PushType int

	CronExpr string
}

type PushPlus

type PushPlus struct {
	Token string
}

func (*PushPlus) PushMarkdown

func (p *PushPlus) PushMarkdown(title string, content string) (string, error)

type Pusher

type Pusher interface {
	// contains filtered or unexported methods
}

推送接口

type Task

type Task struct {
	CronExpr string
	Coupon   Coupon
}

type TimeResponse

type TimeResponse struct {
	Code    int    `json:"code"`
	SubCode int    `json:"subcode"`
	Msg     string `json:"msg"`
	Data    int64  `json:"data"`
}

type WxPusher

type WxPusher struct {
	AppToken string
	UId      string
}

func (*WxPusher) PushMarkdown

func (w *WxPusher) PushMarkdown(title string, content string) (string, error)

Jump to

Keyboard shortcuts

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