alpha

package
v0.0.0-...-f92ab88 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlphaVantageEconomicData

type AlphaVantageEconomicData struct {
	Date  time.Time `json:"date"`
	Value big.Float `json:"value"`
}

func (*AlphaVantageEconomicData) UnmarshalJSON

func (l *AlphaVantageEconomicData) UnmarshalJSON(j []byte) error

type AlphaVantageEconomicResponse

type AlphaVantageEconomicResponse struct {
	Name     string                     `json:"Name"`
	Interval string                     `json:"Interval"`
	Unit     string                     `json:"Unit"`
	Data     []AlphaVantageEconomicData `json:"Data"`
}

type AlphaVantageEconomicService

type AlphaVantageEconomicService struct {
	EconomicRepository data.EconomicRepository
	ReportRepository   data.ReportRepository
	Client             ClientInterface
	Logger             *jsonlog.Logger
	Limiter            AlphaVantageLimiter
}

func (AlphaVantageEconomicService) GetAll

func (s AlphaVantageEconomicService) GetAll(reportType data.ReportType) (*[]data.Economic, error)

GetAll Gets all the data for an economic table if no data is found, a request is sent to the API to get the data to populate the DB

func (AlphaVantageEconomicService) GetIntervalWithPercentChange

func (s AlphaVantageEconomicService) GetIntervalWithPercentChange(ctx context.Context, wg *sync.WaitGroup, dataChan chan data.EconomicWithChangeResult, errChan chan error, reportType data.ReportType, years int, paging data.Paging)

func (AlphaVantageEconomicService) GetStats

func (s AlphaVantageEconomicService) GetStats(ctx context.Context, wg *sync.WaitGroup, dataChan chan data.EconomicStatsResult, errChan chan error, reportType data.ReportType, years int, timeBucketDays int, paging data.Paging)

func (AlphaVantageEconomicService) StartDataSyncTask

func (s AlphaVantageEconomicService) StartDataSyncTask()

type AlphaVantageLimiter

type AlphaVantageLimiter struct {
	MinuteLimiter *rate.Limiter
	DailyLimiter  *rate.Limiter
}

type ClientInterface

type ClientInterface interface {
	EconomicData(ctx context.Context, reportType alpha.ReportType, opts *alpha.Options) (*alphavantage.EconomicResponse, error)
}

type DataSyncTaskParams

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

Jump to

Keyboard shortcuts

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