Versions in this module Expand all Collapse all v0 v0.4.0 Aug 12, 2023 Changes in this version + var ErrInvalidEventID = errors.New("invalid event id") + var ErrInvalidUserID = errors.New("invalid user id") + var ErrMultipleEvents = errors.New("invalid ics file (multiple events)") + var ErrNoEvents = errors.New("invalid ics file (no events)") + var ErrorLogger = log.New(os.Stdout, "", log.LstdFlags) + func GetCalendar(ctx context.Context, userID string, productID string, name string) (*ics.Calendar, error) + func GetICSEvent(ctx context.Context, event *ElphiEvent) (*ics.VEvent, error) + func GetMerkliste(ctx context.Context, userID string) ([]string, error) + type CachedMerkliste struct + EventCache *ttlcache.Cache[string, *ElphiEvent] + ICSCache *ttlcache.Cache[string, *ics.VEvent] + Name string + ProductID string + TTL time.Duration + func NewCachedMerkliste(ttl time.Duration) *CachedMerkliste + func (m *CachedMerkliste) GetCalendar(ctx context.Context, userID string) (*ics.Calendar, error) + func (m *CachedMerkliste) GetElphiEvent(ctx context.Context, eventID string) (*ElphiEvent, error) + func (m *CachedMerkliste) GetICSEvent(ctx context.Context, event *ElphiEvent) (*ics.VEvent, error) + func (m *CachedMerkliste) RegisterMetrics(variableLabels []string, staticLabels prometheus.Labels) + func (m *CachedMerkliste) StartCacheExpiration() + func (m *CachedMerkliste) StopCacheExpiration() + type CalendarHandler struct + Merkliste *CachedMerkliste + Prefix string + func (h *CalendarHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) + type ElphiEvent struct + Description string + EndDate string + HTML string + ID string + ImageCopyright string + ImageURL string + ModificationDate string + Room string + StartDate string + Subtitle string + Title string + URL string + WebsiteURL string + func GetElphiEvent(ctx context.Context, eventID string) (*ElphiEvent, error) + type EventHandler struct + Merkliste *CachedMerkliste + Prefix string + func (h *EventHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)