events

package
v0.0.0-...-e04d7a9 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeRegistrationLinks(events []*Event)

func CreateCalendar

func CreateCalendar(eventsList []*Event, now time.Time, baseUrl utils.Url, calendarUrl string, path string) error

func CreateEventCalendar

func CreateEventCalendar(event *Event, now time.Time, baseUrl utils.Url, calendarUrl string, path string) error

func FindPrevNextEvents

func FindPrevNextEvents(eventList []*Event)

func FindSiblings

func FindSiblings(eventList []*Event, today time.Time)

func FindUpcomingNearEvents

func FindUpcomingNearEvents(eventList []*Event, upcomingEvents []*Event, maxDistanceKM float64, count int)

func LoadSheets

func LoadSheets(config SheetsConfigData, today time.Time) ([]*Event, []*Event, []*Event, []*ParkrunEvent, []*Tag, []*Serie, error)

func NonSeparators

func NonSeparators(events []*Event) int

func SplitEvents

func SplitEvents(eventList []*Event) ([]*Event, []*Event)

func SplitObsolete

func SplitObsolete(eventList []*Event) ([]*Event, []*Event)

func ValidateDateOrder

func ValidateDateOrder(events []*Event)

func ValidateNameOrder

func ValidateNameOrder(eventList []*Event)

Types

type CheckUrl

type CheckUrl struct {
	Url   string
	Event *Event
	Name  string
}

type Columns

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

type Data

type Data struct {
	Events         []*Event
	EventsOld      []*Event
	EventsObsolete []*Event
	Groups         []*Event
	GroupsObsolete []*Event
	Shops          []*Event
	ShopsObsolete  []*Event
	Tags           []*Tag
	Series         []*Serie
	SeriesOld      []*Serie
	ParkrunEvents  []*ParkrunEvent
}

func FetchData

func FetchData(config SheetsConfigData, today time.Time) (Data, error)
func (data *Data) CheckLinks()

type Event

type Event struct {
	Type           string
	Name           utils.Name
	NameOld        utils.Name
	Time           utils.TimeRange
	Old            bool
	Status         string
	Cancelled      bool
	Obsolete       bool
	Special        bool
	Location       Location
	Details        string
	Details2       template.HTML
	Url            string
	RawTags        []string
	Tags           []*Tag
	RawSeries      []string
	Series         []*Serie
	Links          []*utils.Link
	Calendar       string
	CalendarGoogle string
	Added          string
	New            bool
	Prev           *Event
	Next           *Event
	UpcomingNear   []*Event
	Meta           EventMeta
}

func AddMonthSeparators

func AddMonthSeparators(eventList []*Event) []*Event

func AddMonthSeparatorsDescending

func AddMonthSeparatorsDescending(eventList []*Event) []*Event

func Reverse

func Reverse(s []*Event) []*Event

func (*Event) CalendarSlug

func (event *Event) CalendarSlug() string

func (Event) GenerateDescription

func (event Event) GenerateDescription() string

func (Event) GetUUID

func (event Event) GetUUID() (uuid.UUID, error)

func (Event) IsSeparator

func (event Event) IsSeparator() bool

func (*Event) LinkTitle

func (event *Event) LinkTitle() string

func (*Event) NiceType

func (event *Event) NiceType() string

func (*Event) Slug

func (event *Event) Slug() string

func (*Event) SlugFile

func (event *Event) SlugFile() string

func (*Event) SlugNoBase

func (event *Event) SlugNoBase() string

func (*Event) SlugOld

func (event *Event) SlugOld() string

type EventMeta

type EventMeta struct {
	Current  bool
	BaseName utils.Name
	Siblings []*Event
}

type Location

type Location struct {
	City      string
	Country   string
	Geo       string
	Lat       float64
	Lon       float64
	Distance  string
	Direction string
}

func CreateLocation

func CreateLocation(locationS, coordinatesS string) Location

func (Location) Dir

func (loc Location) Dir() string

func (Location) DirLong

func (loc Location) DirLong() string

func (Location) GoogleMaps

func (loc Location) GoogleMaps() string

func (Location) HasGeo

func (loc Location) HasGeo() bool

func (Location) Name

func (loc Location) Name() string

func (Location) NameNoFlag

func (loc Location) NameNoFlag() string

func (Location) Tags

func (loc Location) Tags() []string

type ParkrunEvent

type ParkrunEvent struct {
	IsCurrentWeek bool
	Index         string
	Date          string
	Runners       string
	Temp          string
	Special       string
	Cafe          string
	Results       string
	Report        string
	Author        string
	Photos        string
}

type Serie

type Serie struct {
	Name        utils.Name
	Description template.HTML
	Links       []*utils.Link
	Events      []*Event
	EventsOld   []*Event
	Groups      []*Event
	Shops       []*Event
}

func CreateSerie

func CreateSerie(id string, name string) *Serie

func GetSerie

func GetSerie(series map[string]*Serie, name string) *Serie

func (Serie) IsOld

func (s Serie) IsOld() bool

func (Serie) Num

func (s Serie) Num() int

func (*Serie) Slug

func (serie *Serie) Slug() string

type SheetsConfigData

type SheetsConfigData struct {
	ApiKey  string `json:"api_key"`
	SheetId string `json:"sheet_id"`
}

func LoadSheetsConfig

func LoadSheetsConfig(path string) (SheetsConfigData, error)

type Tag

type Tag struct {
	Name        utils.Name
	Description string
	Events      []*Event
	EventsOld   []*Event
	Groups      []*Event
	Shops       []*Event
}

func CreateTag

func CreateTag(name string) *Tag

func GetTag

func GetTag(tags map[string]*Tag, name string) *Tag

func (*Tag) NumEvents

func (tag *Tag) NumEvents() int

func (*Tag) NumGroups

func (tag *Tag) NumGroups() int

func (*Tag) NumOldEvents

func (tag *Tag) NumOldEvents() int

func (*Tag) NumShops

func (tag *Tag) NumShops() int

func (*Tag) Slug

func (tag *Tag) Slug() string

Jump to

Keyboard shortcuts

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