services

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CronTriggerNetwork 网络重置每天8点55分
	CronTriggerNetwork = "55 8 * * *"
	// CronTriggerInit 定制任务初始化cron定位9点
	CronTriggerInit = "0 9 * * *"
	// CronDefaultInterval 默认的执行频次
	CronDefaultInterval = "@every 10s"
	// CronTickInterval tick级别数据的更新频次
	CronTickInterval = "@every 1s"
)

Variables

View Source
var (
	ErrAlreadyExists = errors.New("the job already exists") // 任务已经存在
	ErrForbidden     = errors.New("the job was forbidden")  // 任务被禁止
)

Functions

func CheckoutCanSellStockList added in v1.2.3

func CheckoutCanSellStockList(sellStrategyId uint64, holdings []string) []string

CheckoutCanSellStockList 捡出T+HoldingPeriod日的股票列表

func DaemonService

func DaemonService()

DaemonService 守护进程服务入口

func IsTrading added in v0.6.8

func IsTrading(status int) bool

IsTrading 状态是否交易中

func PrintJobList added in v0.5.6

func PrintJobList()

PrintJobList 输出定时任务列表

func Register

func Register(name, spec string, callback func()) error

Register 注册定时任务

Types

type Task added in v0.4.9

type Task struct {
	Service func() // 任务函数
	// contains filtered or unexported fields
}

Task 定时任务

默认每10秒检测1次
排名不分先后

Jump to

Keyboard shortcuts

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