Documentation ¶
Overview ¶
Package quandl provides low-level access to the www.qunadl.com web service. It it designed to cover features available to non-paying registred users.
Index ¶
Constants ¶
const Layout string = "2006-01-02"
Layout used to format time to/from strings.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Q ¶
type Q struct {
// contains filtered or unexported fields
}
Q is the QUANDL query structure. It is thread safe.
func New ¶
New construct a new Q with the specified options. The source (eg : EURONEXT) is regquired. Existing Q may be used multiple times to query different time series from the same Source.
func (*Q) WalkDataset ¶
func (q *Q) WalkDataset( serie string, processor RecordProcessor)
WalkDataset will collect Records from the source/data-serie and process each record with the provided processor.
type QOption ¶
type QOption func(*Q)
A QOption is an option that can be provided when constructing a new Q.
OptionOrderAsc ascending order.
OptionOrderDesc descending order.
func OptionFrequency ¶
OptionFrequency sets the sampling frequency.
func OptionLimit ¶
OptionLimit sets the number of dataset returned. Set limit to 1 to return the last dataset.
func OptionStartDate ¶
OptionStartDate sets the start date.
type Record ¶
type Record struct { Date time.Time `gorm:"primary_key"` Source string Serie string `gorm:"primary_key"` Measure string `gorm:"primary_key"` Value float64 `gorm:"NOT NULL"` }
Record elementary data structure, as retrieved from a source/serie. This is the format used to communicate to the external world.
type RecordProcessor ¶
type RecordProcessor func(Record)
RecordProcessor knows how to process a Record