service

package
v0.0.0-...-45d551c Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 21 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***",
}
View Source
var DefaultCronSpec = "05 17 * * MON,TUE,WED,THU,FRI"

Functions

func BuildRangeCode

func BuildRangeCode() chan string

func CollectMetadataFromLog

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

func CollectMetadataFromSina

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

func CompleteTaskToRepository

func CompleteTaskToRepository(date string, metadata, stock, day, week int64) error

func DeleteMetadataByDate

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

func FetchMetadataFromSina

func FetchMetadataFromSina(today time.Time, delay bool) (string, int64, error)

func InsertMetadataMany

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

func PushMetadataToRepository

func PushMetadataToRepository(date string) (int64, int64, int64, int64, error)

func RunScheduler

func RunScheduler()

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