blockchain/internal/domain/repository/data_source.go

25 lines
530 B
Go
Raw Normal View History

2025-08-04 08:58:30 +00:00
package repository
import (
"blockchain/internal/domain/entity"
"context"
)
type DataSourceRepository interface {
2025-08-04 14:02:01 +00:00
GetSymbols(ctx context.Context) ([]*entity.Symbol, error)
2025-08-06 23:41:18 +00:00
Downloader
2025-08-04 17:01:27 +00:00
}
2025-08-06 23:41:18 +00:00
type Downloader interface {
2025-08-05 23:41:29 +00:00
// FetchHistoryKline 抓歷史 K 線資料
2025-08-05 14:11:01 +00:00
FetchHistoryKline(ctx context.Context, param QueryKline) ([]*entity.Kline, error)
2025-08-05 23:41:29 +00:00
SaveHistoryKline(ctx context.Context, data []*entity.Kline) error
2025-08-05 14:11:01 +00:00
}
type QueryKline struct {
Symbol string
Interval string
StartUnixNano int64
EndUnixNano int64
2025-08-04 08:58:30 +00:00
}