Documentation
¶
Overview ¶
main.go — yfin CLI composition root; wires every sub-package's `Register` onto `cmd.RootCmd` then forwards `cmd.Execute()` to the process. Exit non-zero on error.
Directories
¶
| Path | Synopsis |
|---|---|
|
build.go — build-time version variables injected via `-ldflags` at compile time.
|
build.go — build-time version variables injected via `-ldflags` at compile time. |
|
admin
admin.go — `config` + `version` cobra subcommands grouped under one sub-package because both are admin/maintenance commands (no network I/O).
|
admin.go — `config` + `version` cobra subcommands grouped under one sub-package because both are admin/maintenance commands (no network I/O). |
|
dispatch
batch.go — `batch` cobra subcommand + worker-pool driver that fans every ticker through every entry in `commandRegistry`, honoring the tiered cache and writing per-command JSON files (plus `_failed` error logs).
|
batch.go — `batch` cobra subcommand + worker-pool driver that fans every ticker through every entry in `commandRegistry`, honoring the tiered cache and writing per-command JSON files (plus `_failed` error logs). |
|
format
financials.go — ComprehensiveFinancialsDTO → stdout summary, covering the financials / balance-sheet / cash-flow pages, plus the populated-field counter it reports.
|
financials.go — ComprehensiveFinancialsDTO → stdout summary, covering the financials / balance-sheet / cash-flow pages, plus the populated-field counter it reports. |
|
fundamentals
fundamentals.go — `fundamentals` + `comprehensive-stats` + `comprehensive-profile` cobra subcommands 共用 sub-package。
|
fundamentals.go — `fundamentals` + `comprehensive-stats` + `comprehensive-profile` cobra subcommands 共用 sub-package。 |
|
market
client_json.go — local-export sink shared between `pull` and `quote`.
|
client_json.go — local-export sink shared between `pull` and `quote`. |
|
scrape
format.go — pure DTO → stdout formatters for the scrape subcommand's preview modes (analysis / analyst-insights).
|
format.go — pure DTO → stdout formatters for the scrape subcommand's preview modes (analysis / analyst-insights). |
|
soak
command
client.go — builds the soak facade client from one loaded config snapshot.
|
client.go — builds the soak facade client from one loaded config snapshot. |
|
tools/golden
command
manifest_check.go — golden-manifest validator CLI: verifies file existence, SHA256 and schema-specific JSON shape, including daily-bar time semantics.
|
manifest_check.go — golden-manifest validator CLI: verifies file existence, SHA256 and schema-specific JSON shape, including daily-bar time semantics. |
|
twse
twse.go — `twse` cobra subcommand.
|
twse.go — `twse` cobra subcommand. |
|
adapters.go — mechanical accessors on `*Config` that hand out flat / nested views of the root config tree:
|
adapters.go — mechanical accessors on `*Config` that hand out flat / nested views of the root config tree: |
|
Package facade owns yfin's public operation boundary.
|
Package facade owns yfin's public operation boundary. |
|
samples/api_usage
command
`api_usage.go` — programmatic tour of `facade.Client.Scrape*` covering financials, key statistics, analysis, news, and the all-fundamentals batch.
|
`api_usage.go` — programmatic tour of `facade.Client.Scrape*` covering financials, key statistics, analysis, news, and the all-fundamentals batch. |
|
samples/historical_data
command
`historical_data_example.go` — end-to-end look at `facade.Client` historical APIs: daily bars, intraday bars, and a spot quote.
|
`historical_data_example.go` — end-to-end look at `facade.Client` historical APIs: daily bars, intraday bars, and a spot quote. |
|
samples/print_all_data_types
command
`print_all_data_types.go` — exhaustive dump of every `facade.FundamentalsSnapshot` variant (analysis, analyst insights, balance sheet, cash flow) plus JSON marshaling and `ScrapeAllFundamentals` source differentiation.
|
`print_all_data_types.go` — exhaustive dump of every `facade.FundamentalsSnapshot` variant (analysis, analyst insights, balance sheet, cash flow) plus JSON marshaling and `ScrapeAllFundamentals` source differentiation. |
|
samples/print_data_contents
command
`print_data_contents.go` — field-by-field walk of `facade.Quote`, `facade.BarBatch`, news, financials, and key-statistics snapshots, including JSON marshaling.
|
`print_data_contents.go` — field-by-field walk of `facade.Quote`, `facade.BarBatch`, news, financials, and key-statistics snapshots, including JSON marshaling. |
|
scrape_convert.go — DTO → model direct converters for the scrape path.
|
scrape_convert.go — DTO → model direct converters for the scrape path. |
|
svc
|
|
|
scrape
analysis.go — parses Yahoo analysis pages into earnings/revenue estimates, history, EPS trend/revisions, and growth DTOs.
|
analysis.go — parses Yahoo analysis pages into earnings/revenue estimates, history, EPS trend/revisions, and growth DTOs. |
|
twse
bfiauu_stock.go — `BFIAUU_STOCK` thin wrapper that adds `stockNo` requirement then delegates to `BFIAUU` (same 10-column row shape).
|
bfiauu_stock.go — `BFIAUU_STOCK` thin wrapper that adds `stockNo` requirement then delegates to `BFIAUU` (same 10-column row shape). |
|
yahoo
Fetches/extracts Yahoo dividends + splits from `/v8/finance/chart` `events` (1-year lookback).
|
Fetches/extracts Yahoo dividends + splits from `/v8/finance/chart` `events` (1-year lookback). |
|
utils
|
|
|
cache
Package cache owns reusable yfin cache mechanics.
|
Package cache owns reusable yfin cache mechanics. |
|
httpx
body.go — Gzip auto-decode + per-response body size cap shared by `Caller.Get`.
|
body.go — Gzip auto-decode + per-response body size cap shared by `Caller.Get`. |
|
obsv
metrics.go — Prometheus metrics for request, retry, backoff, decode, circuit-breaker, latency, and inflight HTTP state.
|
metrics.go — Prometheus metrics for request, retry, backoff, decode, circuit-breaker, latency, and inflight HTTP state. |
Click to show internal directories.
Click to hide internal directories.