Documentation ¶
Index ¶
- Constants
- Variables
- func ActionChecker() func(c *cli.Context) error
- func ActionExportor() func(c *cli.Context) error
- func ActionIndex() func(c *cli.Context) error
- func ActionJSON() func(c *cli.Context) error
- func ActionWebserver() func(c *cli.Context) error
- func Check(ctx context.Context, keywords []string, opts core.CheckerOptions) (results map[string]core.CheckResult, err error)
- func CommandChecker() *cli.Command
- func CommandExportor() *cli.Command
- func CommandIndex() *cli.Command
- func CommandJSON() *cli.Command
- func CommandWebserver() *cli.Command
- func DefaultGinMiddlewares() []gin.HandlerFunc
- func Export(ctx context.Context, exportFilename string, selector core.Selector)
- func FlagsChecker() []cli.Flag
- func FlagsCheckerOptions() []cli.Flag
- func FlagsExportor() []cli.Flag
- func FlagsFilter() []cli.Flag
- func FlagsIndex() []cli.Flag
- func FlagsJSON() []cli.Flag
- func FlagsWebserver() []cli.Flag
- func NewCheckerOptions(c *cli.Context) core.CheckerOptions
- func NewFilter(c *cli.Context) eastmoney.Filter
- type Exportor
- func (e Exportor) ExportCSV(ctx context.Context, filename string) (result []byte, err error)
- func (e Exportor) ExportExcel(ctx context.Context, filename string) (result []byte, err error)
- func (e Exportor) ExportJSON(ctx context.Context, filename string) (result []byte, err error)
- func (e Exportor) ExportPic(ctx context.Context, filename string) (result []byte, err error)
Constants ¶
View Source
const (
// ProcessorChecker 检测器
ProcessorChecker = "checker"
)
View Source
const (
// ProcessorExportor 导出器
ProcessorExportor = "exportor"
)
View Source
const (
// ProcessorIndex 指数数据处理
ProcessorIndex = "index"
)
View Source
const (
// ProcessorJSON 导出json数据文件
ProcessorJSON = "json"
)
View Source
const (
// ProcessorWebserver web 服务
ProcessorWebserver = "webserver"
)
Variables ¶
View Source
var ( // HeaderStyle 表头样式 HeaderStyle = &excelize.Style{ Border: []excelize.Border{ {Type: "left", Color: "000000", Style: 1}, {Type: "right", Color: "000000", Style: 1}, {Type: "top", Color: "000000", Style: 1}, {Type: "bottom", Color: "000000", Style: 1}, }, Fill: excelize.Fill{ Type: "pattern", Pattern: 1, Color: []string{"FFCCCC"}, Shading: 0, }, Font: &excelize.Font{ Bold: true, }, Alignment: &excelize.Alignment{ Horizontal: "center", JustifyLastLine: true, Vertical: "center", WrapText: true, }, } // BodyStyle 表格Style BodyStyle = &excelize.Style{ Alignment: &excelize.Alignment{ Horizontal: "left", JustifyLastLine: true, Vertical: "center", WrapText: true, }, } )
View Source
var ( // DefaultExportFilename 要导出的文件名默认值 DefaultExportFilename = fmt.Sprintf("./dist/investool.%s.xlsx", time.Now().Format("20060102")) )
View Source
var PicChuckSize = 15
PicChuckSize 每张图片最多展示股票数
Functions ¶
func ActionIndex ¶ added in v1.3.4
func ActionIndex() func(c *cli.Context) error
ActionIndex cli action
func ActionJSON ¶ added in v1.3.6
func ActionJSON() func(c *cli.Context) error
ActionJSON dump json files
func Check ¶
func Check(ctx context.Context, keywords []string, opts core.CheckerOptions) (results map[string]core.CheckResult, err error)
Check 对给定名称或代码进行检测,输出检测结果
func DefaultGinMiddlewares ¶
func DefaultGinMiddlewares() []gin.HandlerFunc
DefaultGinMiddlewares 默认的 gin server 使用的中间件列表
func FlagsCheckerOptions ¶
func FlagsCheckerOptions() []cli.Flag
FlagsCheckerOptions exportor checker flags
func NewCheckerOptions ¶
func NewCheckerOptions(c *cli.Context) core.CheckerOptions
NewCheckerOptions 从命令行参数解析 CheckerOptions
Types ¶
type Exportor ¶
type Exportor struct { Stocks models.ExportorDataList Selector core.Selector }
Exportor exportor 实例
func (Exportor) ExportExcel ¶
ExportExcel 导出 excel
func (Exportor) ExportJSON ¶
ExportJSON 数据导出为 JSON 文件 不传文件名则返回 []bytes,传文件名则保存到文件
Click to show internal directories.
Click to hide internal directories.