command

package
v1.11.7 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = 1024      // Kilo Byte
	MB = 1024 * KB // Mega Byte
	GB = 1024 * MB // Giga Byte
)

Variables

View Source
var (
	Application = "stock"
	MinVersion  = "0.0.1" // 主程序版本号
)
View Source
var CmdBackTesting = &cmder.Command{
	Use:   "backtesting",
	Short: "回测",
	Run: func(cmd *cmder.Command, args []string) {
		securityCode = strings.TrimSpace(securityCode)
		securityCode = exchange.CorrectSecurityCode(securityCode)
		if len(securityCode) > 0 {
			tracker.CheckStrategy(strategyCode, securityCode, date)
		} else {
			tracker.BackTesting(strategyCode, days, topN)
		}
	},
}

CmdBackTesting 回测

View Source
var CmdBestIP = &cmder.Command{
	Use:   "bestip",
	Short: "检测服务器网速",
	Run: func(cmd *cmder.Command, args []string) {
		quotes.BestIP()
	},
}

CmdBestIP 检测服务器地址

View Source
var CmdConfig = &cmder.Command{
	Use:   "config",
	Short: "显示配置信息",
	Run: func(cmd *cmder.Command, args []string) {
		data, err := yaml.Marshal(config.GlobalConfig)
		if err != nil {
			fmt.Println(err)
		} else {
			fmt.Println(api.Bytes2String(data))
		}
	},
}

CmdConfig 显示配置信息

View Source
var (
	CmdPrint *cmder.Command = nil // CmdPrint 打印命令
)
View Source
var (
	// CmdRepair 补登历史数据
	CmdRepair *cmder.Command = nil
)
View Source
var CmdRules = &cmder.Command{
	Use:   "rules",
	Short: "规则",
	Args: func(cmd *cmder.Command, args []string) error {
		return nil
	},

	PreRun: func(cmd *cmder.Command, args []string) {

	},
	Run: func(cmd *cmder.Command, args []string) {
		rules.PrintRuleList()
	},
}

CmdRules 规则

View Source
var (
	// CmdSafes 安全类-黑白名单
	CmdSafes *cmder.Command = nil
)
View Source
var (
	// CmdService 守护进程
	CmdService *cmder.Command
)
View Source
var (
	CmdTools *cmder.Command = nil // 工具集合

)
View Source
var (
	CmdTracker *cmder.Command = nil // 实时跟踪
)
View Source
var (
	// CmdUpdate 更新数据
	CmdUpdate *cmder.Command = nil
)
View Source
var CmdVersion = &cmder.Command{
	Use:   "version",
	Short: "显示版本号",
	Run: func(cmd *cmder.Command, args []string) {
		fmt.Println(MinVersion)
	},
}

CmdVersion 版本

Functions

func FirstLower

func FirstLower(s string) string

FirstLower 字符串首字母小写

func FirstUpper

func FirstUpper(s string) string

FirstUpper 字符串首字母大写

func GlobalFlags

func GlobalFlags() *cli.Command

GlobalFlags engine支持的全部命令

func InitCommands

func InitCommands()

InitCommands 公开初始化函数

func UpdateApplicationName

func UpdateApplicationName(name string)

UpdateApplicationName 更新应用(Application)名称

func UpdateApplicationVersion

func UpdateApplicationVersion(v string)

UpdateApplicationVersion 更新版本号

Types

type Command

type Command = cmder.Command

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the daemon service struct

func (*Service) Manage

func (service *Service) Manage() (string, error)

Manage by daemon commands or run the daemon

func (*Service) Run

func (service *Service) Run()

func (*Service) Start

func (service *Service) Start()

func (*Service) Stop

func (service *Service) Stop()

Jump to

Keyboard shortcuts

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