balances

package
v0.0.0-...-4f87207 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeDeposit    = "deposit"
	TypeWithdrawal = "withdrawal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	Currency string
	// contains filtered or unexported fields
}

func NewReport

func NewReport(currency string, rows []Transaction) Report

func (*Report) Balance

func (r *Report) Balance() float64

func (*Report) Deposits

func (r *Report) Deposits() float64

func (*Report) Withdrawals

func (r *Report) Withdrawals() float64

type Sync

type Sync struct {
	// contains filtered or unexported fields
}

func NewSync

func NewSync(db *gorm.DB, api *poloniex.Poloniex) *Sync

func (*Sync) GetLastTime

func (sync *Sync) GetLastTime() time.Time

func (*Sync) Sync

func (sync *Sync) Sync(start, end time.Time) (int, error)

func (*Sync) SyncAll

func (sync *Sync) SyncAll() (int, error)

func (*Sync) SyncRecent

func (sync *Sync) SyncRecent() (int, error)

type Transaction

type Transaction struct {
	gorm.Model

	// deposit / withdrawal
	Type string

	WithdrawalNumber int64 // only withdrawals
	Currency         string
	Address          string
	Amount           float64
	Confirmations    int
	TransactionID    string `gorm:"unique"`
	Timestamp        time.Time
	Status           string
	IPAddress        string // only withdrawals
}

merge two struct - poloniex.PoloniexDepositsWithdrawals.Deposits - poloniex.PoloniexDepositsWithdrawals.Withdrawals

type View

type View struct {
	// contains filtered or unexported fields
}

func NewView

func NewView(db *gorm.DB) *View

func (*View) CurrencyRows

func (v *View) CurrencyRows(currency string) []Transaction

Jump to

Keyboard shortcuts

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