command

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 33 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)
		} 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 added in v1.2.8

func FirstLower(s string) string

FirstLower 字符串首字母小写

func FirstUpper added in v1.2.8

func FirstUpper(s string) string

FirstUpper 字符串首字母大写

func GlobalFlags added in v0.7.9

func GlobalFlags() *cmder.Command

GlobalFlags engine支持的全部命令

func InitCommands added in v1.0.2

func InitCommands()

InitCommands 公开初始化函数

func UpdateApplicationName added in v0.2.3

func UpdateApplicationName(name string)

UpdateApplicationName 更新应用(Application)名称

func UpdateApplicationVersion added in v0.1.5

func UpdateApplicationVersion(v string)

UpdateApplicationVersion 更新版本号

Types

type Command added in v0.1.3

type Command = cmder.Command

type Service added in v0.4.4

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

Service is the daemon service struct

func (*Service) Manage added in v0.4.4

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

Manage by daemon commands or run the daemon

func (*Service) Run added in v0.4.4

func (service *Service) Run()

func (*Service) Start added in v0.4.4

func (service *Service) Start()

func (*Service) Stop added in v0.4.4

func (service *Service) Stop()

Jump to

Keyboard shortcuts

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