Documentation ¶
Index ¶
- func SimpleUpsert[T schema.Tabler](tx *gorm.DB, data ...T) error
- type QueryFilter
- type Repository
- func (r *Repository) BlacklistSymbol(symbol string) error
- func (r *Repository) CleanCoinPriceHistory() (inserted int64, deleted int64, err error)
- func (r *Repository) CleanOldPairHistory() (inserted int64, deleted int64, err error)
- func (r *Repository) DeleteAllCoins(tx *gorm.DB) error
- func (r *Repository) DeleteAllDiff(tx *gorm.DB) error
- func (r *Repository) DisableCoin(coin string) error
- func (r *Repository) GetAllCoins() ([]model.Coin, error)
- func (r *Repository) GetAvgLastPairRatioBetween(pairID uint, start, end time.Time) (decimal.Decimal, error)
- func (r *Repository) GetBalanceHistory() ([]model.BalanceHistory, error)
- func (r *Repository) GetBlacklistedSymbols() ([]model.BlacklistedSymbol, error)
- func (r *Repository) GetBotFirstLaunch() (time.Time, error)
- func (r *Repository) GetCharts(modifiers ...QueryFilter) ([]model.Chart, error)
- func (r *Repository) GetCoinPricesSince(coins []string, altCoin string, from time.Time) ([]model.CoinPrice, error)
- func (r *Repository) GetCoinsLastPrice(altCoin string) ([]model.CoinPrice, error)
- func (r *Repository) GetCurrentCoin() (model.CurrentCoin, bool, error)
- func (r *Repository) GetDefaultChartsWithBestDiff() ([]model.Chart, error)
- func (r *Repository) GetDiff(filters ...QueryFilter) ([]model.Diff, error)
- func (r *Repository) GetEnabledCoins() ([]string, error)
- func (r *Repository) GetJumps(filters ...QueryFilter) ([]model.Jump, error)
- func (r *Repository) GetLastBalanceHistory() (model.BalanceHistory, error)
- func (r *Repository) GetLastPairRatiosBefore(t time.Time) ([]model.PairHistory, error)
- func (r *Repository) GetPairRatiosSince(fromCoin, toCoin string, from time.Time) ([]model.PairHistory, error)
- func (r *Repository) GetPairs(filters ...QueryFilter) (map[string]model.Pair, error)
- func (r *Repository) LogCurrentCoin()
- func (r *Repository) ReplaceAllDiff(computedDiff []model.Diff) error
- func (r *Repository) SaveNewCoinPriceChart(chartType string, coins []string, days string) (model.Chart, error)
- func (r *Repository) SetCurrentCoin(coin string, ts time.Time) (model.CurrentCoin, error)
- func (r *Repository) Vacuum() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type QueryFilter ¶
func ExistingPair ¶
func ExistingPair() QueryFilter
func FromCoin ¶
func FromCoin(coin string) QueryFilter
func Limit ¶
func Limit(limit int) QueryFilter
func OrderBy ¶
func OrderBy(columns ...string) QueryFilter
func Pair ¶
func Pair(from, to string) QueryFilter
func ToCoin ¶
func ToCoin(coin string) QueryFilter
func Type ¶
func Type(t string) QueryFilter
type Repository ¶
type Repository struct { DB *db.DB ConfigFile *configfile.ConfigFile Logger *log.Logger }
func NewRepository ¶
func NewRepository(db *db.DB, cf *configfile.ConfigFile, l *log.Logger) *Repository
func (*Repository) BlacklistSymbol ¶
func (r *Repository) BlacklistSymbol(symbol string) error
func (*Repository) CleanCoinPriceHistory ¶
func (r *Repository) CleanCoinPriceHistory() (inserted int64, deleted int64, err error)
func (*Repository) CleanOldPairHistory ¶
func (r *Repository) CleanOldPairHistory() (inserted int64, deleted int64, err error)
func (*Repository) DeleteAllCoins ¶
func (r *Repository) DeleteAllCoins(tx *gorm.DB) error
func (*Repository) DeleteAllDiff ¶
func (r *Repository) DeleteAllDiff(tx *gorm.DB) error
func (*Repository) DisableCoin ¶
func (r *Repository) DisableCoin(coin string) error
func (*Repository) GetAllCoins ¶
func (r *Repository) GetAllCoins() ([]model.Coin, error)
func (*Repository) GetAvgLastPairRatioBetween ¶
func (*Repository) GetBalanceHistory ¶
func (r *Repository) GetBalanceHistory() ([]model.BalanceHistory, error)
func (*Repository) GetBlacklistedSymbols ¶
func (r *Repository) GetBlacklistedSymbols() ([]model.BlacklistedSymbol, error)
func (*Repository) GetBotFirstLaunch ¶
func (r *Repository) GetBotFirstLaunch() (time.Time, error)
func (*Repository) GetCharts ¶
func (r *Repository) GetCharts(modifiers ...QueryFilter) ([]model.Chart, error)
func (*Repository) GetCoinPricesSince ¶
func (*Repository) GetCoinsLastPrice ¶
func (r *Repository) GetCoinsLastPrice(altCoin string) ([]model.CoinPrice, error)
func (*Repository) GetCurrentCoin ¶
func (r *Repository) GetCurrentCoin() (model.CurrentCoin, bool, error)
func (*Repository) GetDefaultChartsWithBestDiff ¶
func (r *Repository) GetDefaultChartsWithBestDiff() ([]model.Chart, error)
func (*Repository) GetDiff ¶
func (r *Repository) GetDiff(filters ...QueryFilter) ([]model.Diff, error)
func (*Repository) GetEnabledCoins ¶
func (r *Repository) GetEnabledCoins() ([]string, error)
func (*Repository) GetJumps ¶
func (r *Repository) GetJumps(filters ...QueryFilter) ([]model.Jump, error)
func (*Repository) GetLastBalanceHistory ¶
func (r *Repository) GetLastBalanceHistory() (model.BalanceHistory, error)
func (*Repository) GetLastPairRatiosBefore ¶
func (r *Repository) GetLastPairRatiosBefore(t time.Time) ([]model.PairHistory, error)
func (*Repository) GetPairRatiosSince ¶
func (r *Repository) GetPairRatiosSince(fromCoin, toCoin string, from time.Time) ([]model.PairHistory, error)
func (*Repository) GetPairs ¶
func (r *Repository) GetPairs(filters ...QueryFilter) (map[string]model.Pair, error)
func (*Repository) LogCurrentCoin ¶
func (r *Repository) LogCurrentCoin()
func (*Repository) ReplaceAllDiff ¶
func (r *Repository) ReplaceAllDiff(computedDiff []model.Diff) error
func (*Repository) SaveNewCoinPriceChart ¶
func (*Repository) SetCurrentCoin ¶
func (r *Repository) SetCurrentCoin(coin string, ts time.Time) (model.CurrentCoin, error)
func (*Repository) Vacuum ¶
func (r *Repository) Vacuum() error
Click to show internal directories.
Click to hide internal directories.