report

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtfIntervalReport

type EtfIntervalReport struct {
	IntervalInDays                                            int
	MinPrice, MaxPrice, IntervalChange, IntervalPercentChange float32
}

EtfIntervalReport represents a report containing etf for a specific interval.

type EtfReport

type EtfReport struct {
	Symbol                              string
	CurrentPrice, Change, PercentChange float32
	IntervalReports                     []EtfIntervalReport
}

EtfReport repesents a report containg etf data.

func (*EtfReport) String

func (r *EtfReport) String() string

String outputs a string representation for the report.

type ReportGenerator

type ReportGenerator struct {
	Intervals []int
}

Represents a report generator.

func NewReportGenerator

func NewReportGenerator(options ...ReportGeneratorOption) (*ReportGenerator, error)

NewReportGenerator initializes a new report generator.

func (*ReportGenerator) GenerateReport

func (rg *ReportGenerator) GenerateReport(etf data.Etf) (EtfReport, error)

GenerateReport generates a report based on the provided etf struct.

type ReportGeneratorOption

type ReportGeneratorOption func(*ReportGenerator)

ReportGeneratorOption represents a report generator option.

func WithIntervals

func WithIntervals(intervals []int) ReportGeneratorOption

WithIntervals sets the intervals option on a report generator.

Jump to

Keyboard shortcuts

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