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
- func Backend() gofiler.Backend
- func FeedURL(feed string) (*url.URL, error)
- func Open(ctx context.Context, u *url.URL, cache gofiler.CacheStore, opts gofiler.Opts) (gofiler.Filer, error)
- type Filer
- func (self *Filer) Actions() []gofiler.Action
- func (self *Filer) Clone(ctx context.Context, patch url.Values) (gofiler.Filer, error)
- func (self *Filer) CreateObject(context.Context, schema.CreateObjectRequest) (*schema.Object, error)
- func (self *Filer) DeleteObjects(context.Context, schema.DeleteObjectsRequest) (*schema.DeleteObjectsResponse, error)
- func (self *Filer) Description() string
- func (self *Filer) GetObject(ctx context.Context, req schema.GetObjectRequest) (*schema.Object, error)
- func (self *Filer) ListObjects(ctx context.Context, req schema.ListObjectsRequest) (schema.ListObjectsIterator, error)
- func (self *Filer) ReadObject(ctx context.Context, req schema.GetObjectRequest) (gofiler.ReadObjectFunc, *schema.Object, error)
- func (self *Filer) URL() *url.URL
- func (self *Filer) WatchObjects(ctx context.Context, ch chan<- schema.Event) error
Constants ¶
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 ¶
Backend returns the backend of calendar feeds, of URLs of webcal://<name>/<host>/<path>
func FeedURL ¶
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) Clone ¶
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 ¶
func (self *Filer) DeleteObjects(context.Context, schema.DeleteObjectsRequest) (*schema.DeleteObjectsResponse, error)
DeleteObjects isn't allowed, as a feed is read-only
func (*Filer) Description ¶
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 ¶
func (self *Filer) ListObjects(ctx context.Context, req schema.ListObjectsRequest) (schema.ListObjectsIterator, error)
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 ¶
func (self *Filer) ReadObject(ctx context.Context, req schema.GetObjectRequest) (gofiler.ReadObjectFunc, *schema.Object, error)
ReadObject returns the iCalendar of an event
func (*Filer) 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 ¶
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.