Documentation ¶
Index ¶
- Constants
- type CalendarJob
- type Job
- func (job *Job) ComposeText() *Job
- func (job *Job) FetchUntil(until time.Time) *Job
- func (job *Job) OmitEmptyMeta(key metaKey) *Job
- func (job *Job) OmitIfAllKeysEmpty() *Job
- func (job *Job) OmitSuspicious() *Job
- func (job *Job) OmitUnlistedStocks() *Job
- func (job *Job) RemoveClones() *Job
- func (job *Job) Run() JobFunc
- func (job *Job) SaveToDB() *Job
- type JobFunc
- type SummaryJob
Constants ¶
const ( MetaTickers metaKey = "Tickers" MetaMarkets metaKey = "Markets" )
Based on the composer.ComposedMeta struct keys.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalendarJob ¶
type CalendarJob struct {
// contains filtered or unexported fields
}
CalendarJob is the struct that will fetch calendar events and publish them to the channel.
func NewCalendarJob ¶
func NewCalendarJob( calendarScavenger *ecal.EconomicCalendar, publisher *publisher.TelegramPublisher, archivist *archivist.Archivist, providerName string, ) *CalendarJob
func (*CalendarJob) RunCalendarUpdatesJob ¶
func (j *CalendarJob) RunCalendarUpdatesJob() JobFunc
RunCalendarUpdatesJob fetches "Actual" values for today's events and publishes updates to the channel.
func (*CalendarJob) RunWeeklyCalendarJob ¶
func (j *CalendarJob) RunWeeklyCalendarJob() JobFunc
RunWeeklyCalendarJob creates events plan for the upcoming week and publishes them to the channel. It should be run once a week on Monday.
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job will be executed by the scheduler and will fetch, compose, publish and save news to the database.
func NewJob ¶
func NewJob( composer *composer.Composer, publisher *publisher.TelegramPublisher, archivist *archivist.Archivist, journalist *journalist.Journalist, stocks *stocks.StockMap, ) *Job
NewJob creates a new Job instance.
func (*Job) ComposeText ¶
ComposeText sets the flag that will compose text for the article using OpenAI.
func (*Job) FetchUntil ¶
FetchUntil sets the date until which the articles will be fetched.
func (*Job) OmitEmptyMeta ¶
OmitEmptyMeta will omit news with empty meta for the given key from composer.ComposedMeta. Note: requires ComposeText to be set.
func (*Job) OmitIfAllKeysEmpty ¶
OmitIfAllKeysEmpty will omit articles with empty meta for all keys from composer.ComposedMeta.
Example: "{"Markets": [], "Tickers": [], "Hashtags": []}" will be omitted, but "{"Markets": ["SPY"], "Tickers": [], "Hashtags": []}" will not.
func (*Job) OmitSuspicious ¶
OmitSuspicious sets the flag that will omit suspicious articles.
func (*Job) OmitUnlistedStocks ¶
OmitUnlistedStocks sets the flag that will omit articles publishing with stocks unlisted in the Job.stocks.
func (*Job) RemoveClones ¶
RemoveClones sets the flag that will remove duplicated news found in the DB.
type JobFunc ¶
type JobFunc func()
JobFunc is a type for job function that will be executed by the scheduler.
type SummaryJob ¶
type SummaryJob struct {
// contains filtered or unexported fields
}
func NewSummaryJob ¶
func NewSummaryJob( composer *composer.Composer, publisher *publisher.TelegramPublisher, archivist *archivist.Archivist, ) *SummaryJob