bitflyer

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrTypeUnknown int = iota
	TrTypeBuy
	TrTypeSell
	TrTypeReceive
	TrTypeDeposit
	TrTypeWithdraw
	TrTypeTransfer
	TrTypeFee
)
View Source
const (
	En = "en"
	Jp = "jp"
)
View Source
const (
	DealTypeUnkown = iota
	DealTypeNone
	DealTypeSelf
	DealTypeMed
)
View Source
const FiatCode = "JPY"
View Source
const WalletCode = "BF"

Variables

This section is empty.

Functions

func NewReader

func NewReader(r io.Reader) io.Reader

func ValidateColumnNames

func ValidateColumnNames(lang string, names []string) error

ValidateColumnNames checks columns

Types

type ColumnID

type ColumnID int
const (
	TrDate ColumnID = iota
	Currency
	TrType
	TrPrice
	Currency1
	Currency1Quantity
	Fee
	Currency1JPYRate
	Currency2
	Currency2Quantity
	DealType
	OrderID
	Remarks
)

type Extractor

type Extractor struct {
}

Extractor for BitFlyer

func NewExecutor

func NewExecutor() *Extractor

NewExecutor create an executor for BitFlyer

func (*Extractor) Execute

func (e *Extractor) Execute(ctx context.Context, db boil.ContextExecutor, reader io.Reader, options ...eupholio.Option) error

Execute performs ETL

type Record

type Record []string

func MakeRecords

func MakeRecords(lang string, head []string, rows [][]string) ([]Record, error)

func (Record) Currency

func (r Record) Currency() string

func (Record) Currency1

func (r Record) Currency1() string

func (Record) Currency1JPYRate

func (r Record) Currency1JPYRate() *decimal.Big

func (Record) Currency1Quantity

func (r Record) Currency1Quantity() *decimal.Big

func (Record) Currency2

func (r Record) Currency2() string

func (Record) Currency2Quantity

func (r Record) Currency2Quantity() *decimal.Big

func (Record) DealType

func (r Record) DealType() int

func (Record) Fee

func (r Record) Fee() *decimal.Big

func (Record) Get

func (r Record) Get(id ColumnID) string

func (Record) OrderID

func (r Record) OrderID() string

func (Record) Remarks

func (r Record) Remarks() string

func (Record) TrPrice

func (r Record) TrPrice() *decimal.Big

func (Record) TrType

func (r Record) TrType() int

type Repository

type Repository interface {
	FindTransactions(ctx context.Context, start, end time.Time) (models.BFTransactionSlice, error)
	FindTransactionsByYear(ctx context.Context, year int, location *time.Location) (models.BFTransactionSlice, error)
	CreateTransactions(ctx context.Context, trs models.BFTransactionSlice) error
}

func NewRepository

func NewRepository(db boil.ContextExecutor) Repository

type TableWriter

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

func NewTableWriter

func NewTableWriter(w io.Writer) *TableWriter

func (*TableWriter) PrintTransactions

func (t *TableWriter) PrintTransactions(slice models.BFTransactionSlice)

func (*TableWriter) PrintTransactionsShort

func (t *TableWriter) PrintTransactionsShort(slice models.BFTransactionSlice)

func (*TableWriter) Write

func (t *TableWriter) Write(value interface{}) error

type TransactionHistory

type TransactionHistory struct {
	Transactions models.BFTransactionSlice
}

func Extract

func Extract(reader io.Reader) (*TransactionHistory, error)

Extract extracts transactions from a reader

func ExtractFromFile

func ExtractFromFile(path string) (*TransactionHistory, error)

type Translator

type Translator struct {
}

func NewTranslator

func NewTranslator() *Translator

func (*Translator) Translate

func (t *Translator) Translate(ctx context.Context, repo eupholio.Repository, start, end time.Time) error

Translate stores extracted transaction data to transaction table

Jump to

Keyboard shortcuts

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