cache

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INFO_PATH = "info"
	DAY_PATH  = "day"
)

Variables

This section is empty.

Functions

func CheckFilepath

func CheckFilepath(filename string) error

CheckFilepath 检查filename 文件路径, 如果不存在就创建

func GetCache added in v1.2.0

func GetCache(fullCode string) *os.File

func GetCacheFilename added in v1.2.0

func GetCacheFilename(fullCode string) string

GetCacheFilename 获取缓存的文件名

func GetDayPath

func GetDayPath() string

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

func GetInfoPath

func GetInfoPath() string

GetInfoPath 证券信息路径

func Init

func Init(path string) error

Init 初始化缓存路径

func LoadKLine

func LoadKLine(fc string) []Cache.DayKLine

LoadKLine 加载日线文件

Types

type CacheType added in v1.2.0

type CacheType int
const (
	CACHE_TARS CacheType = iota
	CACHE_CSV
)
var (
	// CACHE_ROOT_PATH cache路径
	CACHE_ROOT_PATH = category.DATA_ROOT_PATH
	CACHE_TYPE      CacheType
)

type DataFrame added in v1.2.0

type DataFrame struct {
	Length int       `json:"length"`
	Date   []string  `json:"date"`
	Open   []float64 `json:"open"`
	High   []float64 `json:"high"`
	Low    []float64 `json:"low"`
	Close  []float64 `json:"close"`
	Volume []int64   `json:"volume"`
}

DataFrame 数据帧

func LoadDataFrame added in v1.2.0

func LoadDataFrame(code string) *DataFrame

LoadDataFrame 加载数据帧

func (DataFrame) Offset added in v1.2.0

func (this DataFrame) Offset(n int) (date []string, vOpen []float64, vClose []float64, vHigh []float64, vLow []float64, vVolume []int64)

type FastCache

type FastCache struct {
	Data []byte
	// contains filtered or unexported fields
}

func Create

func Create(filename string, size int64) (*FastCache, error)

func Open

func Open(filename string) (*FastCache, error)

func (*FastCache) Close

func (fc *FastCache) Close()

Jump to

Keyboard shortcuts

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