Categorygithub.com/jordic/goics
modulepackage
0.0.0-20210404174824-5a0337b716a0
Repository: https://github.com/jordic/goics.git
Documentation: pkg.go.dev

# README

A go toolkit for decoding, encoding icalendar ics ical files

Alpha status

Build Status

After trying to decode some .ics files and review available go packages, I decided to start writing this pacakge.

First attempt was from a fixed structure, similar to that needed. Later, I started to investigate the format and discovered that it is a pain, and has many variants, depending on who implements it. For this reason I evolved it to a tookit for decode and encode the format.

Check examples dir for user cases:

Demo app encoding an ical, using a mysql DB source

Features implemented:

  • Parsing and writing of vevent, not completly..
  • No recursive events,
  • And no alarms inside events

Follows: http://tools.ietf.org/html/rfc5545

TODO

Integrate testing from: https://github.com/libical/libical

CHANGELOG:

  • v00. First api traial
  • v01. Api evolves to a ical toolkit
  • v02. Added example of integration with a mysql db.

Thanks to: Joe Shaw Reviewing first revision.

# Packages

No description provided by the author

# Functions

DecodeLine extracts key, val and extra params from a line.
FormatDateField returns a formated date: "DTEND;VALUE=DATE:20140406".
FormatDateTime as "DTSTART:19980119T070000Z".
FormatDateTimeField in the form "X-MYDATETIME;VALUE=DATE-TIME:20120901T130000".
NewComponent returns a new Component and setups and setups Properties map for the component and also allows more Components inside it.
NewDecoder creates an instance of de decoder.
NewICalEncode generates a new encoder, and needs a writer.
WriteStringField UID:asdfasdfа[email protected].

# Constants

Line endings.
Line endings.

# Variables

Errors.
Errors.
LineSize of the ics format.

# Structs

Calendar holds the base struct for a Component VCALENDAR.
Component is the base type for holding a ICal datatree before serilizing it.
Event holds the base struct for a Event Component during decoding.
ICalEncode is the real writer, that wraps every line, in 75 chars length..
IcsNode is a basic token.., with, key, val, and extra params to define the type of val.

# Interfaces

Componenter defines what should be a component that can be rendered with others components inside and some properties CALENDAR >> VEVENT ALARM VTODO.
ICalConsumer is the realy important part of the decoder lib The decoder is organized around the Provider/Consumer pattern.
ICalEmiter must be implemented in order to allow objects to be serialized It should return a *goics.Calendar and optional a map of fields and their serializers, if no serializer is defined, it will serialize as string..