Documentation ¶
Index ¶
- Constants
- Variables
- func CacheId(code string) string
- func CacheIdPath(code string) string
- func CorrectDate(date string) (cacheDate, resourcesDate string)
- func DefaultCanReadDate() string
- func DefaultCanUpdateDate() string
- func FundFlowFilename(securityCode string) string
- func GetDayPath() string
- func GetFundFlowPath() string
- func GetHoldingPath() string
- func GetInfoPath() string
- func GetLoggerPath() string
- func GetMetaPath() string
- func GetMinutePath() string
- func GetQmtCachePath() string
- func GetQuarterlyPath() stringdeprecated
- func GetRootPath() string
- func GetSnapshotPath() string
- func GetTransPath() string
- func GetVariablePath() string
- func GetWidePath() string
- func GetXdxrPath() string
- func GetZxgFile() string
- func KLineFilename(code string) string
- func MinuteFilename(code, date string) string
- func PreviewReportFilename(date string) string
- func QuarterlyReportFilename(code, date string) string
- func Register(plugin DataAdapter) error
- func ReportsFilename(date string) string
- func Reset()
- func SnapshotFilename(securityCode string) string
- func Today() string
- func Top10HoldersFilename(code, date string) string
- func TransFilename(code, date string) string
- func WideFilename(code string) string
- func XdxrFilename(code string) string
- type DataAdapter
- type DataFile
- type DataSummary
- type Depend
- type Future
- type Handover
- type Increase
- type Initialization
- type Kind
- type Manifest
- type OpKind
- type Operator
- type Properties
- type Schema
- type ScoreBoard
- type Swift
- type Validator
Constants ¶
View Source
const ( KBarIndex = "barIndex" KLineMin = 120 // K线最少记录数 )
View Source
const ( TDX_FORMAT_PROTOCOL_DATE = "20060102" // 通达信协议的日期字符串格式 CACHE_DATE = "20060102" // 缓存日期 INDEX_DATE = "2006-01-02" // 索引日期格式 TDX_DATE = "20060102" // 通达信日期 YearOnly = "2006" // 仅年份 TimeStampMilli = "2006-01-02 15:04:05.000" TimeStampMicro = "2006-01-02 15:04:05.000000" TimeStampNano = "2006-01-02 15:04:05.000000000" )
View Source
const (
// DefaultDataProvider 默认数据提供者
DefaultDataProvider = "engine"
)
View Source
const (
FilenameDate = "20060102" // 缓存文件相关的日期格式
)
View Source
const (
UseGoroutine = false // 更新和修复数据是否启用协程
)
Variables ¶
View Source
var (
ErrAlreadyExists = errors.New("the plugin already exists")
)
Functions ¶
func CacheIdPath ¶
CacheIdPath code从后保留3位, 市场缩写+从头到倒数第3的代码, 确保每个目录只有000~999个代码
func CorrectDate ¶ added in v0.1.5
CorrectDate 校正日期
func DefaultCanReadDate ¶ added in v0.1.5
func DefaultCanReadDate() string
DefaultCanReadDate 获取默认可以读缓存文件的日期
func DefaultCanUpdateDate ¶ added in v0.1.5
func DefaultCanUpdateDate() string
DefaultCanUpdateDate 获取默认可以更新缓存文件的日期
func FundFlowFilename ¶ added in v0.5.1
FundFlowFilename 通过证券代码获取资金流向的缓存文件路径
func GetQuarterlyPath
deprecated
added in
v0.1.5
func MinuteFilename ¶ added in v0.5.3
func PreviewReportFilename ¶ added in v0.6.2
PreviewReportFilename 业绩预告文件名
func QuarterlyReportFilename ¶ added in v0.1.5
QuarterlyReportFilename 季报存储路径
info |-- YYYYQ1 |-- sh600105.report |-- YYYYQ2 |-- YYYYQ3 |-- YYYYQ4 Deprecated: 不推荐使用
func ReportsFilename ¶ added in v0.1.5
ReportsFilename 报告数据文件名
func SnapshotFilename ¶ added in v0.5.1
SnapshotFilename 快照数据文件
func Top10HoldersFilename ¶ added in v0.1.5
Top10HoldersFilename 前十大流通股股东缓存文件名
func TransFilename ¶ added in v1.1.5
TransFilename 历史成交数据文件比较多, 目录结构${tick}/${YYYY}/${YYYYMMDD}/${CacheIdPath}
Types ¶
type DataAdapter ¶ added in v0.3.2
type DataAdapter interface { // Schema 继承基础特性接口 Schema // Print 控制台输出指定日期的数据 Print(code string, date ...string) }
DataAdapter 数据插件
func Plugins ¶ added in v0.1.7
func Plugins(mask ...Kind) (list []DataAdapter)
Plugins 按照类型标志位捡出数据插件
func PluginsWithName ¶ added in v0.2.0
func PluginsWithName(pluginType Kind, keywords ...string) (list []DataAdapter)
type DataFile ¶ added in v0.3.2
type DataFile interface { // Checkout 捡出指定日期的缓存数据 Checkout(securityCode, date string) // Filename 缓存文件名 // 接受两个参数 日期和证券代码 // 文件名为空不缓存 Filename(date, securityCode string) string // Check 数据校验 Check(cacheDate, featureDate string) error }
DataFile 基础数据文件接口
type DataSummary ¶ added in v0.3.2
type DataSummary struct {
// contains filtered or unexported fields
}
DataSummary 数据概要
func Summary ¶ added in v0.3.2
func Summary(kind Kind, key, name, owner string) DataSummary
func (DataSummary) Key ¶ added in v0.3.2
func (d DataSummary) Key() string
func (DataSummary) Kind ¶ added in v0.3.2
func (d DataSummary) Kind() Kind
func (DataSummary) Name ¶ added in v0.3.2
func (d DataSummary) Name() string
func (DataSummary) Owner ¶ added in v0.3.2
func (d DataSummary) Owner() string
func (DataSummary) Usage ¶ added in v0.3.4
func (d DataSummary) Usage() string
type Future ¶ added in v0.3.2
type Future interface { // Update 更新数据 // whole 是否完整的数据, false是加工成半成品数据, 为了配合Increase Update(securityCode, cacheDate, featureDate string, whole bool) // Repair 回补数据 Repair(securityCode, cacheDate, featureDate string, whole bool) }
Future 预备数据的接口
type Handover ¶ added in v0.1.7
type Handover interface { // ChangingOverDate 缓存数据转换日期 // 数据集等基础数据不需要切换日期 ChangingOverDate(date string) }
Handover 缓存切换接口
type Increase ¶ added in v0.3.2
type Increase[T any] interface { Add(data T) T }
Increase 增量数据计算接口
deprecated: 不推荐
type Initialization ¶ added in v0.3.4
type Initialization interface { // Init 初始化, 接受context, 日期和证券代码作为入参 Init(ctx context.Context, date string) error }
Initialization 初始化接口
type Manifest ¶ added in v0.3.8
type Manifest interface { Schema Properties Initialization }
Manifest 提要
type Properties ¶ added in v0.3.4
type Properties interface { // GetDate 日期 GetDate() string // GetSecurityCode 证券代码 GetSecurityCode() string }
Properties 属性接口
type Schema ¶ added in v0.3.9
type Schema interface { // Kind 数据类型 Kind() Kind // Owner 提供者 Owner() string // Key 数据关键词, key与cache落地强关联 Key() string // Name 特性名称 Name() string // Usage 控制台参数提示信息, 数据描述(data description) Usage() string }
Schema 缓存的概要信息
type ScoreBoard ¶ added in v0.3.2
type ScoreBoard struct { Kind Kind `name:"kind"` // 类型 Count int `name:"count"` // 总数 Max time.Duration `name:"max"` // 最大值 Min time.Duration `name:"min"` // 最小值 CrossTime time.Duration `name:"cross_time"` // 总耗时 Speed float64 `name:"speed"` // 速度 // contains filtered or unexported fields }
ScoreBoard 记分牌
func (*ScoreBoard) String ¶ added in v0.3.2
func (this *ScoreBoard) String() string
Click to show internal directories.
Click to hide internal directories.