webcal

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 31 Imported by: ? modules, 0 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.

Documentation

Overview

Package webcal is a backend of an iCalendar feed, which a calendar is subscribed to, of webcal://<name>/<host>/<path>, whose events are files, of their days, /YYYY/YYYY-MM/DD-<title>.ics, each an iCalendar of the event, with its changes to the times it repeats. It's read-only, and is polled, at its refresh interval, for the changes to its events, of their UIDs. A feed which isn't modified, of its entity tag, or when it was last modified, isn't fetched again.

Index

Constants

View Source
const (
	// Scheme is the scheme of a feed's volume's URL,
	// webcal://<name>/<host>/<path>, which is a feed's own scheme too, as a
	// calendar's "Subscribe" links have, webcal://<host>/<path>
	Scheme = "webcal"

	// Description is what the backend is
	Description = "Calendar subscription"

	// DefaultRefresh is how often a feed is polled, and how long it's kept,
	// when the refresh_interval option isn't set
	DefaultRefresh = 5 * time.Minute
)

Variables

This section is empty.

Functions

func Backend

func Backend() gofiler.Backend

Backend returns the backend of calendar feeds, of URLs of webcal://<name>/<host>/<path>

func FeedURL

func FeedURL(feed string) (*url.URL, error)

FeedURL returns the URL of a feed, of one which is http, https, or webcal, such as a calendar's "Subscribe" link, which is fetched as https, or an error when it's none of them

func Open

func Open(ctx context.Context, u *url.URL, cache gofiler.CacheStore, opts gofiler.Opts) (gofiler.Filer, error)

Open creates the backend of the feed of the URL, webcal://<name>/<host>/<path>, whose name is its name option, or its host. The feed is https://<host>/<path>, or http, with insecure=true, with the parameters of the URL's query which aren't the volume's options: name, refresh_interval, readonly, insecure, index and description. The feed is fetched, so one which can't be is an error, and is described of its name, unless it has a description option.

Types

type Filer

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

Filer is the backend of an iCalendar feed

func New

func New(ctx context.Context, name string, feed *url.URL, params url.Values, cache gofiler.CacheStore, opts gofiler.Opts) (*Filer, error)

New creates the backend of a feed, of its URL, which is http or https, the volume's options, its refresh_interval, and its description, and its cache

func (*Filer) Actions

func (self *Filer) Actions() []gofiler.Action

Actions returns nil, as a feed is read-only

func (*Filer) Clone

func (self *Filer) Clone(ctx context.Context, patch url.Values) (gofiler.Filer, error)

Clone returns a new backend of the feed, with its options changed by the patch, which fetches it, as a new one does

func (*Filer) CreateObject

func (self *Filer) CreateObject(context.Context, schema.CreateObjectRequest) (*schema.Object, error)

CreateObject isn't allowed, as a feed is read-only

func (*Filer) DeleteObjects

DeleteObjects isn't allowed, as a feed is read-only

func (*Filer) Description

func (self *Filer) Description() string

Description returns what the feed is, such as "Calendar UK Holidays"

func (*Filer) GetObject

func (self *Filer) GetObject(ctx context.Context, req schema.GetObjectRequest) (*schema.Object, error)

GetObject returns an event, or a folder of its days

func (*Filer) ListObjects

ListObjects lists the folders of the days of the events, and the events, of a folder, or every one beneath it, when it's recursive, or only an event, in the order of their paths, after the path it starts after

func (*Filer) ReadObject

ReadObject returns the iCalendar of an event

func (*Filer) URL

func (self *Filer) URL() *url.URL

URL returns the URL of the feed's volume, webcal://<name>/<host>/<path>, with its options, and the feed's own parameters

func (*Filer) WatchObjects

func (self *Filer) WatchObjects(ctx context.Context, ch chan<- schema.Event) error

WatchObjects polls the feed, at its refresh interval, and sends the changes to its events, and their folders: a rescan of the root first, once it's watched, and then the paths which are created, updated, of their entity tags, or deleted, of each time it changed. A feed which isn't modified, of its entity tag, or when it was last modified, isn't fetched again.

Jump to

Keyboard shortcuts

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