utils

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproxEnd

func ApproxEnd(kind string, start time.Time) time.Time

ApproxEnd calculates approximate end time based on session type

func BuildUISessions

func BuildUISessions(r models.Race, season, round string, resultsURL func(string, string) string) ([]models.UISession, models.UISession, error)

BuildUISessions converts Race data to UI-friendly session format

func CountryCodeToFlag

func CountryCodeToFlag(code string) string

countryCodeToFlag converts ISO 3166-1 alpha-2 country code to flag emoji

func CountryNameToCode

func CountryNameToCode(name, gpName, circuitName string) string

countryNameToCode maps common country names to ISO codes (add as many as needed)

func FetchCircuitSVG

func FetchCircuitSVG(wikiURL string) string

FetchCircuitSVG attempts to fetch circuit SVG (placeholder implementation)

func HasChafa

func HasChafa() bool

HasChafa checks if chafa is available on the system

func OpenURL

func OpenURL(url string)

OpenURL opens a URL in the default browser

func ParseUTC

func ParseUTC(date, t string) (time.Time, error)

ParseUTC parses Ergast date and time strings into UTC time

func RenderWithChafa

func RenderWithChafa(svgPath string) string

RenderWithChafa renders an image using chafa terminal graphics

func ToLocal

func ToLocal(t time.Time) time.Time

ToLocal converts UTC time to local time

Types

This section is empty.

Jump to

Keyboard shortcuts

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