f1calendar

package
v0.0.0-...-4a34f53 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

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

func NewAlert

func NewAlert(fn AlertFn) *Alert

func (*Alert) Push

func (a *Alert) Push(t time.Time, msg string)

func (*Alert) Shutdown

func (a *Alert) Shutdown()

func (*Alert) Start

func (a *Alert) Start(ctx context.Context)

type AlertFn

type AlertFn func(msg string)

func SendTelegramAlert

func SendTelegramAlert(tg MessageSender, subscriptionService subscription.Service) AlertFn

type CachedRaceWeek

type CachedRaceWeek struct {
	RaceWeekRepository
	// contains filtered or unexported fields
}

func NewCachedRaceWeek

func NewCachedRaceWeek(raceWeekRepository RaceWeekRepository) *CachedRaceWeek

func (CachedRaceWeek) GetRaceWeek

func (c CachedRaceWeek) GetRaceWeek() *RaceWeek

type CalendarFetcher

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

func NewCalendarFetcher

func NewCalendarFetcher(endpointURL string) *CalendarFetcher

func (CalendarFetcher) GetRaceWeek

func (c CalendarFetcher) GetRaceWeek() *RaceWeek

type Engine

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

func NewEngine

func NewEngine(raceWeekRepository RaceWeekRepository, alertService *Alert) *Engine

func (*Engine) Start

func (e *Engine) Start(ctx context.Context)

func (*Engine) Stop

func (e *Engine) Stop()

type F1Calendar

type F1Calendar struct {
	Races []Race `json:"races"`
}

type MessageSender

type MessageSender interface {
	SendMessageTo(ctx context.Context, chatID int64, message string)
}

type Race

type Race struct {
	Name      string   `json:"name"`
	Location  string   `json:"location"`
	Latitude  float64  `json:"latitude"`
	Longitude float64  `json:"longitude"`
	Round     int64    `json:"round"`
	Slug      string   `json:"slug"`
	LocaleKey string   `json:"localeKey"`
	Sessions  Sessions `json:"sessions"`
	Affiliate *string  `json:"affiliate,omitempty"`
	Tbc       *bool    `json:"tbc,omitempty"`
}

type RaceWeek

type RaceWeek struct {
	Location string
	Round    int
	Sessions []SessionToBeDone
}

func (RaceWeek) String

func (r RaceWeek) String() string

type RaceWeekRepository

type RaceWeekRepository interface {
	GetRaceWeek() *RaceWeek
}

type SessionToBeDone

type SessionToBeDone struct {
	Name string
	Time time.Time
}

type Sessions

type Sessions map[string]string

Jump to

Keyboard shortcuts

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