ical

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

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 8 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.

README

iCalendar lexer/parser

Go

Golang iCalendar lexer/parser implementing RFC 5545. This project is heavily inspired of the talk Lexical Scanning in Go by Rob Pike.

Usage

import (
    "github.com/luxifer/ical"
)

// filename is an io.Reader
// second parameter is a *time.Location which defaults to system local
calendar, err := ical.Parse(filename, nil)

TODO

  • Implements Missing Properties on VEVENT
  • Implements VTODO
  • Implements VJOURNAL
  • Implements VFREEBUSY
  • Implements VTIMEZONE
  • Implements Missing Components Properties

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	Properties []*Property
	Action     string
	Trigger    string
}

An Alarm represent a VALARM component in an iCalendar

func NewAlarm

func NewAlarm() *Alarm

NewAlarm creates an empty Alarm

type Calendar

type Calendar struct {
	Properties []*Property
	Events     []*Event
	Prodid     string
	Version    string
	Calscale   string
	Method     string
}

A Calendar represents the whole iCalendar

func NewCalendar

func NewCalendar() *Calendar

NewCalendar creates an empty Calendar

func Parse

func Parse(r io.Reader, l *time.Location) (*Calendar, error)

Parse transforms the raw iCalendar into a Calendar struct It's up to the caller to close the io.Reader if the time.Location parameter is not set, it will default to the system location

type Event

type Event struct {
	Properties  []*Property
	Alarms      []*Alarm
	UID         string
	Timestamp   time.Time
	StartDate   time.Time
	EndDate     time.Time
	Summary     string
	Description string
}

An Event represent a VEVENT component in an iCalendar

func NewEvent

func NewEvent() *Event

NewEvent creates an empty Event

type Param

type Param struct {
	Values []string
}

A Param represent a list of param for a property

func NewParam

func NewParam() *Param

NewParam creates an empty Param

type Property

type Property struct {
	Name   string
	Params map[string]*Param
	Value  string
}

A Property represent an unparsed property in an iCalendar component

func NewProperty

func NewProperty() *Property

NewProperty creates an empty Property

Jump to

Keyboard shortcuts

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