Documentation ¶
Index ¶
- Constants
- func NewDefaultConfig(year int) *models.Config
- func NewEventFunc(t time.Time, id int) ...
- type BalanceRepository
- type Config
- type ConfigRepository
- type EntriesOfTransaction
- type EntryRepository
- type EventRepository
- type EventsOfTransaction
- type Extractor
- type Loader
- type MarketPriceRepository
- type Option
- type Repository
- type TransactionRepository
- type Translator
Constants ¶
View Source
const ( EventTypeBuy = "BUY" EventTypeSell = "SELL" EventTypeCommission = "COMMISSION" EventTypeFee = "FEE" EventTypeWithdraw = "WITHDRAW" EventTypeDeposit = "DEPOSIT" )
Event type column values
View Source
const ( EntryTypeOpen = "OPEN" EntryTypeClose = "CLOSE" )
Entry type
Variables ¶
This section is empty.
Functions ¶
func NewDefaultConfig ¶
Types ¶
type BalanceRepository ¶
type ConfigRepository ¶
type EntriesOfTransaction ¶
type EntriesOfTransaction struct { ID int Time time.Time WalletCode string Entries models.EntrySlice Description string }
func FindEntriesOfTransactions ¶
func FindEntriesOfTransactions(ctx context.Context, repo interface { TransactionRepository EntryRepository }, year int, loc *time.Location) ([]*EntriesOfTransaction, error)
type EntryRepository ¶
type EntryRepository interface { CreateEntries(ctx context.Context, entries models.EntrySlice) error UpdateEntries(ctx context.Context, entries models.EntrySlice) error FindEntriesByYear(ctx context.Context, year int, loc *time.Location) (models.EntrySlice, error) FindEntriesByStartAndEnd(ctx context.Context, start, end time.Time) (models.EntrySlice, error) }
type EventRepository ¶
type EventRepository interface { CreateEvents(ctx context.Context, events models.EventSlice) error FindEvents(ctx context.Context) (models.EventSlice, error) FindEventsByYear(ctx context.Context, year int, location *time.Location) (models.EventSlice, error) FindEventsByStartAndEnd(ctx context.Context, start, end time.Time) (models.EventSlice, error) FindEventsByCurrencyStartAndEnd(ctx context.Context, currency currency.Symbol, start, end time.Time) (models.EventSlice, error) }
type EventsOfTransaction ¶
type EventsOfTransaction struct { ID int Time time.Time WalletCode string Events models.EventSlice Description string }
func FindEventsOfTransactions ¶
func FindEventsOfTransactions(ctx context.Context, repo interface { TransactionRepository EventRepository }, year int, loc *time.Location) ([]*EventsOfTransaction, error)
type MarketPriceRepository ¶
type MarketPriceRepository interface { CreateMarketPrices(ctx context.Context, marketPrices models.MarketPriceSlice) error AppendMarketPrices(ctx context.Context, marketPrices models.MarketPriceSlice) error FindLatestMarketPriceByCurrency(ctx context.Context, currency string) (*models.MarketPrice, error) FindMarketPriceByCurrencyAndTime(ctx context.Context, currency string, time time.Time) (*models.MarketPrice, error) }
type Option ¶
type Option func(config *Config)
func DebugOption ¶
func DebugOption() Option
func OverwriteOption ¶
func OverwriteOption() Option
type Repository ¶
type Repository interface { boil.ContextExecutor ConfigRepository TransactionRepository EventRepository EntryRepository MarketPriceRepository BalanceRepository }
type TransactionRepository ¶
type TransactionRepository interface { CreateTransaction(ctx context.Context, time time.Time, exchangeCode string, id int) (*models.Transaction, error) DeleteTransaction(ctx context.Context, exchangeCode string, start, end time.Time) (int64, error) FindTransactionsByYear(ctx context.Context, year int, location *time.Location) (models.TransactionSlice, error) }
type Translator ¶
Click to show internal directories.
Click to hide internal directories.