ratescrapers

package
v1.4.1-rc-131 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CTenor1Avg

type CTenor1Avg struct {
	XMLName    xml.Name `xml:"tenor1,omitempty" json:"tenor1,omitempty"`
	CValue1Avg string   `xml:",chardata" json:",omitempty"`
}

type CTenor2Avg

type CTenor2Avg struct {
	XMLName    xml.Name `xml:"tenor2,omitempty" json:"tenor1,omitempty"`
	CValue2Avg string   `xml:",chardata" json:",omitempty"`
}

type CTenor3Avg

type CTenor3Avg struct {
	XMLName    xml.Name `xml:"tenor3,omitempty" json:"tenor1,omitempty"`
	CValue3Avg string   `xml:",chardata" json:",omitempty"`
}

type CeffectiveDateAvg

type CeffectiveDateAvg struct {
	XMLName     xml.Name `xml:"effectiveDate,omitempty" json:"effectiveDate,omitempty"`
	CEffDateAvg string   `xml:",chardata" json:",omitempty"`
}

type Channel

type Channel struct {
	Title       string `xml:"title"`
	Link        string `xml:"link"`
	Description string `xml:"description"`
}

type CinsertTimestampAvg

type CinsertTimestampAvg struct {
	XMLName       xml.Name `xml:"insertTimestamp,omitempty" json:"insertTimestamp,omitempty"`
	CTimestampAvg string   `xml:",chardata" json:",omitempty"`
}

type Content

type Content struct {
	EstrData EstrData `xml:"EURO-SHORT-TERM-RATE_MID_PUBLICATION_MESSAGE"`
}

type CrateOperationAvg

type CrateOperationAvg struct {
	XMLName             xml.Name             `xml:"rateOperation,omitempty" json:"rateOperation,omitempty"`
	CeffectiveDateAvg   *CeffectiveDateAvg   `xml:"effectiveDate,omitempty" json:"effectiveDate,omitempty"`
	CinsertTimestampAvg *CinsertTimestampAvg `xml:"insertTimestamp,omitempty" json:"insertTimestamp,omitempty"`
	CTenor1Avg          *CTenor1Avg          `xml:"tenor1,omitempty" json:"tenor1,omitempty"`
	CTenor2Avg          *CTenor2Avg          `xml:"tenor2,omitempty" json:"tenor2,omitempty"`
	CTenor3Avg          *CTenor3Avg          `xml:"tenor3,omitempty" json:"tenor3,omitempty"`
}

type CsafrRatesFindItemAvg

type CsafrRatesFindItemAvg struct {
	XMLName           xml.Name           `xml:"safrRatesFindItem,omitempty" json:"safrRatesFindItem,omitempty"`
	CrateOperationAvg *CrateOperationAvg `xml:"rateOperation,omitempty" json:"rateOperation,omitempty"`
}

type CsafrRatesSecondaryFindByDateResponseAvg

type CsafrRatesSecondaryFindByDateResponseAvg struct {
	XMLName               xml.Name                 `xml:"safrRatesSecondaryFindByDateResponse,omitempty" json:"safrRatesSecondaryFindByDateResponse,omitempty"`
	CsafrRatesFindItemAvg []*CsafrRatesFindItemAvg `xml:"safrRatesFindItem,omitempty" json:"safrRatesFindItem,omitempty"`
}

type EstrData

type EstrData struct {
	Results Results `xml:"CALCULATION_RESULTS"`
}
type Header struct {
	ReleaseTitle string `xml:"releaseTitle"`
	ReleaseTime  string `xml:"releaseDateTime"`
}

type Item

type Item struct {
	Title       string     `xml:"title"`
	Link        string     `xml:"link"`
	Description string     `xml:"description"`
	Date        string     `xml:"date"`
	Statistics  Statistics `xml:"statistics"`
}

type ItemInd

type ItemInd struct {
	DescriptionInd string        `xml:"description"`
	DateInd        string        `xml:"date"`
	StatisticsInd  StatisticsInd `xml:"statistics"`
}

type Rate

type Rate struct {
	Value    string `xml:"value"`
	RateType string `xml:"rateType"`
}

type RateInd

type RateInd struct {
	ValueInd    string `xml:"value"`
	RateTypeInd string `xml:"rateType"`
}

type RateScraper

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

func SpawnRateScraper

func SpawnRateScraper(datastore models.Datastore, rateType string) *RateScraper

SpawnRateScraper returns a new RateScraper initialized with default values. The instance is asynchronously scraping as soon as it is created.

func (*RateScraper) Channel

func (s *RateScraper) Channel() chan *models.InterestRate

Channel returns a channel that can be used to receive rate information

func (*RateScraper) Close

func (s *RateScraper) Close() error

Close closes any existing API connections

func (*RateScraper) Update

func (s *RateScraper) Update(rateType string) error

Update calls the appropriate function corresponding to the rate type.

func (*RateScraper) UpdateESTER

func (s *RateScraper) UpdateESTER() error

UpdateESTER makes a GET request from an rss feed and sends updated value through Channel s.chanInterestRate

func (*RateScraper) UpdateSAFR

func (s *RateScraper) UpdateSAFR() error

UpdateSAFR makes a GET request from an rss feed and sends updated value through Channel s.chanInterestRate

func (*RateScraper) UpdateSAFRAvgs

func (s *RateScraper) UpdateSAFRAvgs() error

UpdateSAFRAvgs makes a GET request from an rss feed and sends updated value through Channel s.chanInterestRate

func (*RateScraper) UpdateSOFR

func (s *RateScraper) UpdateSOFR() error

UpdateSOFR makes a GET request from an rss feed and sends updated value through Channel s.chanInterestRate

func (*RateScraper) UpdateSonia

func (s *RateScraper) UpdateSonia() (err error)

type Results

type Results struct {
	RefDate string `xml:"REF_DATE"`
	Rate    string `xml:"RATE"`
}

type RssBody

type RssBody struct {
	Content Content `xml:"content"`
}

type RssESTER

type RssESTER struct {
	Header  Header  `xml:"header"`
	RssBody RssBody `xml:"body"`
}

Define the fields associated with the rss document.

type RssSAFR

type RssSAFR struct {
	ItemInd ItemInd `xml:"item"`
}

Define the fields associated with the rss document.

type RssSOFR

type RssSOFR struct {
	Channel Channel `xml:"channel"`
	Item    Item    `xml:"item"`
}

Define the fields associated with the rss document.

type SONIA

type SONIA struct {
	RefDate time.Time
	RefRate float64
}

type SONIAHistorical

type SONIAHistorical []SONIA

type Statistics

type Statistics struct {
	Country    string `xml:"country"`
	InstAbbrev string `xml:"institutionAbbrev"`
	Rate       Rate   `xml:"interestRate"`
}

type StatisticsInd

type StatisticsInd struct {
	RateInd RateInd `xml:"interestRate"`
}

Jump to

Keyboard shortcuts

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