Documentation ¶
Index ¶
- func CorrectDate(date string) (cacheDate, resourcesDate string)
- func DefaultCanReadDate() string
- func DefaultCanUpdateDate() string
- func RegisterCacheLoader(key string, loader CacheLoader)
- func SwitchDate(date string)
- type Cache1D
- func (this *Cache1D[T]) Apply(merge func(code string, local *T) (updated bool))
- func (this *Cache1D[T]) Get(securityCode string, date ...string) *T
- func (this *Cache1D[T]) Length() int
- func (this *Cache1D[T]) LoadCache(date string)
- func (this *Cache1D[T]) ReplaceCache()
- func (this *Cache1D[T]) Set(securityCode string, newValue T)
- type CacheFeature
- type CacheLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCacheLoader ¶
func RegisterCacheLoader(key string, loader CacheLoader)
func SwitchDate ¶
func SwitchDate(date string)
Types ¶
type Cache1D ¶
type Cache1D[T CacheFeature] struct { Key string // 缓存关键字 Date string // 日期 // contains filtered or unexported fields }
Cache1D 每天1个证券代码1条数据
func NewCache1D ¶
func NewCache1D[T CacheFeature](key string, factory func(date, securityCode string) T) *Cache1D[T]
NewCache1D 创建一个新的C1D对象
key支持多级相对路径, 比如a/b, 创建的路径是~/.quant1x/a/b.yyyy-mm-dd
type CacheFeature ¶
CacheFeature 特征
type CacheLoader ¶
type CacheLoader interface { // LoadCache 加载指定日期的缓存 LoadCache(date string) }
CacheLoader 缓存加载器
Click to show internal directories.
Click to hide internal directories.