Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultScheme = "https" DefaultHost = "www.alphavantage.co" DefaultPath = "/query" )
View Source
const DefaultDateFormat = "2006-01-02"
DefaultDateFormat is the RFC 3339 date format used for parsing dates.
Variables ¶
This section is empty.
Functions ¶
func ParseCSV ¶
ParseCSV parses CSV data into a slice of structs using reflection.
Supported field types:
- string: Direct mapping from CSV column value
- int: Parsed using strconv.ParseInt with base 10
- float64: Parsed using strconv.ParseFloat
- time.Time: Parsed using time.ParseInLocation (see time-layout tag)
Struct field tags:
- `column-name:"header"`: Maps field to CSV column header (required)
- `time-layout:"layout"`: Custom time format for time.Time fields (optional, defaults to "2006-01-02")
Example struct:
type StockPrice struct {
Date time.Time `column-name:"timestamp"`
Open float64 `column-name:"open"`
High float64 `column-name:"high"`
Volume int `column-name:"volume"`
}
Unmapped columns are ignored. Fields without matching columns keep their zero value. Time fields with "null" values remain as zero time.Time.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.