ical

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.1.2

type Config struct {
	URL      string `json:"url"`
	Username string `json:"username"` // can be empty
	Password string `json:"password"` // can be empty
}

func LoadConfig added in v0.1.2

func LoadConfig(jsonfile string) (Config, error)

func MustLoadConfig added in v0.1.2

func MustLoadConfig(jsonfile string) Config

type Event

type Event struct {
	Start   time.Time
	End     time.Time
	UID     string
	URL     string
	Summary string
}

type FeedCache

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

FeedCache gets events from an ical feed and caches them for the given interval. After each interval, calls to update have to wait until the http request is done.

func (*FeedCache) Get

func (fc *FeedCache) Get(location *time.Location) ([]Event, error)

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

Jump to

Keyboard shortcuts

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