Documentation ¶
Index ¶
- type ConnectionInfo
- type DailyRecord
- func (data *DailyRecord) Close() float64
- func (data *DailyRecord) Date() time.Time
- func (data *DailyRecord) High() float64
- func (data *DailyRecord) Low() float64
- func (data *DailyRecord) Open() float64
- func (data *DailyRecord) String() string
- func (data *DailyRecord) Symbol() string
- func (data *DailyRecord) Volume() int
- type DailyRecords
- type PseDb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionInfo ¶
ConnectionInfo represents a database connection information and credentials.
func (ConnectionInfo) ConnectString ¶
func (info ConnectionInfo) ConnectString() string
ConnectString returns a connecction string to be used with sqlx.Open()
func (ConnectionInfo) ConnectStringTemplateDb ¶
func (info ConnectionInfo) ConnectStringTemplateDb() string
ConnectStringTemplateDb returns a connection string to be used with sqlx.Open() that connects to tmeplate1 db which is a default db. Useful for creating databases, or inspecting a db when you're not sure if it exists.
type DailyRecord ¶
type DailyRecord struct {
// contains filtered or unexported fields
}
func NewDailyRecord ¶
func NewDailyRecord(symbol string, date time.Time, open float64, high float64, low float64, close float64, vol int) DailyRecord
NewDailyRecord creates a new DailyRecord from parameters
func NewDailyRecordS ¶
func NewDailyRecordS(d dRow) DailyRecord
func (*DailyRecord) Close ¶
func (data *DailyRecord) Close() float64
Close returns the closing price for that date
func (*DailyRecord) Date ¶
func (data *DailyRecord) Date() time.Time
Date returns the date for the data row
func (*DailyRecord) High ¶
func (data *DailyRecord) High() float64
High returns the highest price for that date
func (*DailyRecord) Low ¶
func (data *DailyRecord) Low() float64
Low returns the lowest price for that date
func (*DailyRecord) Open ¶
func (data *DailyRecord) Open() float64
Open returns the opening price for that date
func (*DailyRecord) String ¶
func (data *DailyRecord) String() string
String returns a string representation of the DailyRecord
func (*DailyRecord) Symbol ¶
func (data *DailyRecord) Symbol() string
Symbol returns the symbol for the data row
func (*DailyRecord) Volume ¶
func (data *DailyRecord) Volume() int
Volume returns the trading volume for that date
type DailyRecords ¶
type DailyRecords interface {
Next() (*DailyRecord, error)
}
type PseDb ¶
type PseDb interface { DbStore() *sqlx.DB Close() error NewData(DailyRecord) error DailyRecordFor(string, time.Time) (DailyRecord, error) AllDailyRecordFor(string) ([]DailyRecord, error) ImportDaylies(DailyRecords) error }
The PseDb interface for CRUD operations and useful shortcuts for retrieving day trades data.
func CreateDb ¶
func CreateDb(info ConnectionInfo) (PseDb, error)
CreateDb creates the underlying PostGreSQL datastore.