Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Intervals = []Interval{ IntervalDaily, IntervalWeekly, IntervalMonthly, }
Functions ¶
func MigrateTables ¶
func MigrateTables(conn *database.Connection) (err error)
Types ¶
type Candle ¶
type Candle struct {
ID uint `gorm:"primarykey;autoIncrement"`
CreatedAt time.Time
UpdatedAt time.Time
// Friendly name of the exchange
ExchangeName string `gorm:"index;not null;uniqueIndex:unique_candle"`
// Trading currency of the symbol
Currency *Currency `gorm:"index;not null;uniqueIndex:unique_candle"`
// API source, useful from identifying from where the data was retrieved
Source string `gorm:"index;not null;uniqueIndex:unique_candle"`
// Ticker symbol
Symbol string `gorm:"index;not null;uniqueIndex:unique_candle"`
// Interval in which the prices are moving daily, weekly or monthly
Interval Interval `gorm:"index;not null;uniqueIndex:unique_candle"`
// Timezone of the passed time
Timezone *Timezone `gorm:"index;not null;uniqueIndex:unique_candle"`
// Timestamp of the values
Time time.Time `gorm:"index;not null;uniqueIndex:unique_candle"`
Open uint64 `gorm:"index;not null"`
High uint64 `gorm:"index;not null"`
Low uint64 `gorm:"index;not null"`
Close uint64 `gorm:"index;not null"`
Volume uint64 `gorm:"index;not null"`
}
Candle records
type Currency ¶
Helper type to manage currencies inside the database
func NewCurrency ¶
func (*Currency) MarshalJSON ¶
func (*Currency) UnmarshalJSON ¶
type Interval ¶
type Interval string
Helper type to handle intervals into the database
func (*Interval) MarshalYAML ¶
type Timezone ¶
Helper type to insert time.Location into the database
func NewTimezone ¶
func (*Timezone) MarshalJSON ¶
func (*Timezone) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.