Documentation ¶
Index ¶
- func RegisterCacheLoader(key string, loader CacheAdapter)
- func SwitchDate(date string)
- type Cache1D
- func (this *Cache1D[T]) Apply(merge func(code string, local *T) (updated bool))
- func (this *Cache1D[T]) Check(cacheDate, featureDate string)
- func (this *Cache1D[T]) Checkout(date ...string)
- func (this *Cache1D[T]) Factory(date, securityCode string) factors.Feature
- func (this *Cache1D[T]) Get(securityCode string, date ...string) *T
- func (this *Cache1D[T]) Init(ctx context.Context, date, securityCode string) error
- func (this *Cache1D[T]) Key() string
- func (this *Cache1D[T]) Kind() cache.Kind
- func (this *Cache1D[T]) Length() int
- func (this *Cache1D[T]) Merge(p *treemap.Map)
- func (this *Cache1D[T]) Name() string
- func (this *Cache1D[T]) Owner() string
- func (this *Cache1D[T]) Print(code string, date ...string)
- func (this *Cache1D[T]) ReplaceCache()
- func (this *Cache1D[T]) Set(securityCode string, newValue T, date ...string)
- func (this *Cache1D[T]) Usage() string
- type CacheAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCacheLoader ¶
func RegisterCacheLoader(key string, loader CacheAdapter)
Types ¶
type Cache1D ¶
type Cache1D[T factors.Feature] struct { Date string // 日期 // contains filtered or unexported fields }
Cache1D 缓存所有证券代码的特征组合数据
每天1个证券代码1条数据
func NewCache1D ¶
func NewCache1D[T factors.Feature](key string, factory func(date, securityCode string) T) *Cache1D[T]
NewCache1D 创建一个新的C1D对象
key支持多级相对路径, 比如a/b, 创建的路径是~/.quant1x/a/b.yyyy-mm-dd
type CacheAdapter ¶
type CacheAdapter interface { // Name 名称 Name() string // Checkout 加载指定日期的缓存 Checkout(date ...string) // Merge 合并数据 Merge(p *treemap.Map) // Factory 工厂 Factory(date, securityCode string) factors.Feature }
CacheAdapter 缓存适配器
一天一个特征组合缓存文件
func Get ¶
func Get(key string) CacheAdapter
Click to show internal directories.
Click to hide internal directories.