filesystem

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVEntry

type CSVEntry struct {
	ID             string
	Status         string
	Timestamp      internal.DateTime
	Type           string
	AssetType      string `csv:"Asset type"`
	Name           string
	Instrument     string
	Shares         float64
	Rate           float64
	Yield          float64 `csv:"Realized yield"`
	Profit         float64 `csv:"Realized PnL"`
	Commission     float64
	Debit          float64
	Credit         float64
	InvestedAmount float64 `csv:"-"`
}

func NewCSVEntry

func NewCSVEntry(
	id, status, transactionType, assetType, name, instrument string,
	shares, rate, yield, profit, commission, debit, credit, investedAmount float64,
	timestamp internal.DateTime,
) CSVEntry

type CSVReader

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

func NewCSVReader

func NewCSVReader(logger *log.Logger) CSVReader

func (CSVReader) Read

func (r CSVReader) Read(filepath string) ([]CSVEntry, error)

type CSVWriter

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

func NewCSVWriter

func NewCSVWriter(logger *log.Logger) CSVWriter

func (CSVWriter) Write

func (w CSVWriter) Write(filepath string, entry CSVEntry) error

type FactoryInterface

type FactoryInterface interface {
	Make(valueObject any) (CSVEntry, error)
}

type JSONReader

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

func NewJSONReader

func NewJSONReader(baseDir string, logger *log.Logger) JSONReader

func (JSONReader) Read

func (r JSONReader) Read(dataType string, data map[string]any) (portfolio.OutputDataInterface, error)

type JSONWriter

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

func NewJSONWriter

func NewJSONWriter(logger *log.Logger) JSONWriter

func (JSONWriter) Bytes

func (w JSONWriter) Bytes(dir string, data []byte) error

type OutputData

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

func (OutputData) Data

func (d OutputData) Data() []byte

Jump to

Keyboard shortcuts

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