service

package
v0.0.0-...-75d25b6 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoStockCode = fmt.Errorf("no exist stock code in Sina API")
	ErrNoStockData = fmt.Errorf("no stock data")
)
View Source
var CodeList = []string{
	"sh688***",
	"sh605***",
	"sh603***",
	"sh601***",
	"sh600***",
	"sz300***",
	"sz0030**",
	"sz002***",
	"sz000***",
}

Functions

func BuildRangeCode

func BuildRangeCode() chan string

func DeleteMetadataByDate

func DeleteMetadataByDate(db *mongo.Client, code, date string, timeout time.Duration) (int64, error)

func FetchMetadataFromLog

func FetchMetadataFromLog(path string) (chan *model.Metadata, error)

FetchMetadataFromSina fetch data from sina

func FetchMetadataFromSina

func FetchMetadataFromSina(codes []string) ([]*model.Metadata, error)

FetchMetadataFromSina fetch data from sina

func InsertMetadataMany

func InsertMetadataMany(db *mongo.Client, metadata []*model.Metadata, timeout time.Duration) (int64, error)

func SelectMetadataRange

func SelectMetadataRange(db *mongo.Client, offset, limit int64, date string, lastID string, timeout time.Duration) ([]*model.Metadata, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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