icalcache

package module
v0.0.0-...-d8aabf5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 11 Imported by: 1 module, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-ical-cache

Go Reference

Package icalcache provides a caching iCalendar client. It caches only a few props (AllDay, Start, End, UID, URL, Summary). The client does up to one HTTP HEAD request every Interval. If the Last-Modified` header has changed, then the feed is fetched from upstream.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Config
	Interval time.Duration // default is two minutes
	// contains filtered or unexported fields
}

func (*Cache) Get

func (cache *Cache) Get(defaultLocation *time.Location) ([]Event, int64, error)

Get returns all events. The defaultLocation parameter is used if the ical data contains no TZID location.

type Config

type Config struct {
	URL           string `json:"url"`
	Username      string `json:"username"` // optional
	Password      string `json:"password"` // optional
	SkipTLSVerify bool   `json:"skip-tls-verify"`
}

func LoadConfig

func LoadConfig(jsonfile string) (Config, error)

type Event

type Event struct {
	AllDay         bool
	Start          time.Time
	End            time.Time
	RecurrenceRule string
	UID            string
	URL            string
	Summary        string
	Description    string
}

Jump to

Keyboard shortcuts

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