eupholio

package
v0.0.0-...-afd3e11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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

func NewDefaultConfig(year int) *models.Config

func NewEventFunc

func NewEventFunc(t time.Time, id int) func(typ, currency string, quantity *decimal.Big, baseCurrency string, baseQuantity *decimal.Big) *models.Event

Types

type BalanceRepository

type BalanceRepository interface {
	CreateBalances(ctx context.Context, balances models.BalanceSlice) error
	FindBalanceByCurrencyAndYear(ctx context.Context, currency string, year int) (*models.Balance, error)
	FindBalancesByYear(ctx context.Context, year int) (models.BalanceSlice, error)
}

type Config

type Config struct {
	Overwrite bool
	Debug     bool
}

type ConfigRepository

type ConfigRepository interface {
	FindConfigByYear(ctx context.Context, year int) (*models.Config, error)
}

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 Extractor

type Extractor interface {
	Execute(ctx context.Context, db boil.ContextExecutor, reader io.Reader, options ...Option) error
}

type Loader

type Loader interface {
	Execute(ctx context.Context, db boil.ContextExecutor, reader io.Reader) 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 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

type Translator interface {
	Translate(ctx context.Context, repo Repository, start, end time.Time) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL