cache

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsExists = errors.New("plugin is already exists")
)

Functions

func CacheId

func CacheId(code string) string

CacheId 通过代码构建目录结构

func CacheIdPath

func CacheIdPath(code string) string

CacheIdPath code从后保留3位, 市场缩写+从头到倒数第3的代码, 确保每个目录只有000~999个代码

func CorrectDate added in v0.1.5

func CorrectDate(date string) (cacheDate, resourcesDate string)

CorrectDate 校正日期

func DefaultCanReadDate added in v0.1.5

func DefaultCanReadDate() string

DefaultCanReadDate 获取默认可以读缓存文件的日期

func DefaultCanUpdateDate added in v0.1.5

func DefaultCanUpdateDate() string

DefaultCanUpdateDate 获取默认可以更新缓存文件的日期

func GetConfigFilename

func GetConfigFilename() string

GetConfigFilename 获取配置文件路径

func GetDayPath

func GetDayPath() string

GetDayPath 历史数据-日线缓存路径

func GetFeaturesPath

func GetFeaturesPath() string

GetFeaturesPath 获取特征路径

func GetFundFlowPath

func GetFundFlowPath() string

GetFundFlowPath 资金流向目录

func GetHoldingPath

func GetHoldingPath() string

GetHoldingPath 十大流通股股东数据路径

func GetInfoPath added in v0.1.5

func GetInfoPath() string

GetInfoPath 信息路径

func GetLoggerPath

func GetLoggerPath() string

GetLoggerPath 获取日志路径

func GetMetaPath

func GetMetaPath() string

GetMetaPath 元数据路径

func GetQuarterlyPath deprecated added in v0.1.5

func GetQuarterlyPath() string

GetQuarterlyPath 季报路径

Deprecated: 不推荐

func GetRootPath

func GetRootPath() string

GetRootPath 获取缓存根路径

func GetSnapshotPath

func GetSnapshotPath() string

GetSnapshotPath 快照路径

func GetTickPath

func GetTickPath() string

GetTickPath tick数据路径

func GetVariablePath

func GetVariablePath() string

GetVariablePath 获取VAR路径

func GetXdxrPath

func GetXdxrPath() string

GetXdxrPath 除权除息文件存储路径

func KLineFilename

func KLineFilename(code string) string

KLineFilename 基础K线缓存路径

func QuarterlyReportFilename added in v0.1.5

func QuarterlyReportFilename(code, date string) string

QuarterlyReportFilename 季报存储路径

info
  |-- YYYYQ1
        |--  sh600105.report
  |-- YYYYQ2
  |-- YYYYQ3
  |-- YYYYQ4
Deprecated: 不推荐使用

func Register added in v0.1.7

func Register(plugin DataPlugin) error

Register 注册插件

func ReportsFilename added in v0.1.5

func ReportsFilename(date string) string

ReportsFilename 报告数据文件名

func Reset

func Reset()

Reset 重置日志记录器

func Top10HoldersFilename added in v0.1.5

func Top10HoldersFilename(code, date string) string

Top10HoldersFilename 前十大流通股股东缓存文件名

func XdxrFilename

func XdxrFilename(code string) string

XdxrFilename XDXR缓存路径

Types

type DataItem added in v0.1.7

type DataItem interface {
	GetDate() string         // 日期
	GetSecurityCode() string // 证券代码
}

DataItem 单行数据

type DataPlugin added in v0.1.7

type DataPlugin interface {
	// Kind 优先级排序字段, 潜在的依赖关系
	Kind() Kind
	// Init 初始化, 加载配置信息
	Init(barIndex *int, date string) error
}

DataPlugin 数据插件

func Plugins added in v0.1.7

func Plugins(mask ...Kind) (list []DataPlugin)

Plugins 按照类型标志位捡出数据插件

type Depend added in v0.1.7

type Depend interface {
	DependOn() []Kind
}

type Handover added in v0.1.7

type Handover interface {
	// ChangingOverDate 缓存数据转换日期
	//	数据集等基础数据不需要切换日期
	ChangingOverDate(date string)
}

Handover 缓存切换接口

type Kind added in v0.1.7

type Kind = uint64
const (
	PluginMaskDataSet Kind = 0x1000000000000000
	PluginMaskFeature Kind = 0x2000000000000000
)

type Quant1XConfig

type Quant1XConfig struct {
	BaseDir string `json:"basedir"`
}

Quant1XConfig Quant1X基础配置

Jump to

Keyboard shortcuts

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