Versions in this module Expand all Collapse all v0 v0.1.2 Aug 27, 2026 v0.1.1 Aug 27, 2026 v0.1.0 Aug 27, 2026 Changes in this version + const CodecVersion + const DevVersion + var ErrChecksum = errors.New("checksum mismatch") + var ErrCorruptArchive = errors.New("corrupt archive") + var ErrIPBanned = errors.New("ip banned") + var ErrInvalidRequest = errors.New("invalid request") + var ErrNotAvailable = errors.New("data not available") + var ErrRateLimited = errors.New("rate limited") + func Closes(klines []Kline) []float64 + func Highs(klines []Kline) []float64 + func Lows(klines []Kline) []float64 + func NormalizeSymbol(s string) (string, error) + func OpenTimes(klines []Kline) []time.Time + func Opens(klines []Kline) []float64 + func Version() string + func Volumes(klines []Kline) []float64 + func WriteParquet(ctx context.Context, w io.Writer, seq iter.Seq2[Kline, error]) (int, error) + type Availability struct + ArchivesThrough time.Time + Daily []time.Time + Interval Interval + Market Market + Monthly []time.Time + Symbol string + func (a Availability) DailyGaps() []time.Time + func (a Availability) MonthlyGaps() []time.Time + type AvailabilityQuery struct + Interval Interval + Market Market + Since time.Time + Symbol string + type CacheEntry struct + Err error + Path string + Sidecar string + Size int64 + type CacheUsage struct + ArchiveCount int + Archives int64 + Other int64 + OtherCount int + Parquet int64 + ParquetCount int + Prunable int64 + PrunableCount int + Root string + SidecarCount int + Sidecars int64 + func (u CacheUsage) Total() int64 + type EvictOptions struct + All bool + Before time.Time + DryRun bool + Intervals []Interval + Symbols []string + type EvictResult struct + Err error + Files []string + Interval Interval + Name string + Period time.Time + Removed bool + Size int64 + Symbol string + type Interval uint8 + const Interval12h + const Interval15m + const Interval1d + const Interval1h + const Interval1m + const Interval1mo + const Interval1s + const Interval1w + const Interval2h + const Interval30m + const Interval3d + const Interval3m + const Interval4h + const Interval5m + const Interval6h + const Interval8h + func Intervals() []Interval + func ParseInterval(s string) (Interval, error) + func (i *Interval) UnmarshalText(text []byte) error + func (i Interval) Duration() (time.Duration, bool) + func (i Interval) HasDailyArchives() bool + func (i Interval) HasMonthlyArchives() bool + func (i Interval) IsValid() bool + func (i Interval) MarshalText() ([]byte, error) + func (i Interval) RESTParam() string + func (i Interval) String() string + type Kline struct + Close udecimal.Decimal + CloseTime time.Time + High udecimal.Decimal + Low udecimal.Decimal + Open udecimal.Decimal + OpenTime time.Time + QuoteVolume udecimal.Decimal + TakerBuyBaseVolume udecimal.Decimal + TakerBuyQuoteVolume udecimal.Decimal + Trades int64 + Volume udecimal.Decimal + func (k Kline) Equal(other Kline) bool + type Loader struct + func NewLoader(opts ...Option) (*Loader, error) + func (l *Loader) Available(ctx context.Context, q AvailabilityQuery) (Availability, error) + func (l *Loader) CacheUsage(ctx context.Context) (CacheUsage, error) + func (l *Loader) EvictCache(ctx context.Context, opts EvictOptions) iter.Seq2[EvictResult, error] + func (l *Loader) Fetch(ctx context.Context, req Request) ([]Kline, error) + func (l *Loader) FetchAll(ctx context.Context, reqs []Request) (map[Request][]Kline, error) + func (l *Loader) PruneArchives(ctx context.Context, opts PruneOptions) iter.Seq2[PruneResult, error] + func (l *Loader) Stream(ctx context.Context, req Request) iter.Seq2[Kline, error] + func (l *Loader) VerifyCache(ctx context.Context) iter.Seq2[CacheEntry, error] + type Market uint8 + const MarketSpot + func ParseMarket(s string) (Market, error) + func (m *Market) UnmarshalText(text []byte) error + func (m Market) IsValid() bool + func (m Market) MarshalText() ([]byte, error) + func (m Market) String() string + type Option interface + func WithCacheDir(dir string) Option + func WithConcurrency(n int) Option + func WithHTTPClient(client *http.Client) Option + func WithLogger(l *slog.Logger) Option + func WithProgress(fn func(Progress)) Option + func WithRateLimit(weightPerSecond float64) Option + type Progress struct + Done int + End time.Time + Err error + Klines int + Request Request + Source Source + Start time.Time + Total int + type PruneOptions struct + DryRun bool + type PruneResult struct + Err error + Kept error + Path string + Removed bool + Size int64 + type Request struct + End time.Time + Interval Interval + Market Market + Start time.Time + Symbol string + func (r Request) Validate() error + type Source uint8 + const SourceDailyArchive + const SourceMonthlyArchive + const SourceRESTAPI + func (s Source) String() string