vareversat / gics

πŸ“… A Go module is implemented to adhere to RFC5545 standards, facilitating the creation and utilization of iCalendars across the internet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GICS πŸ“…

Go badge for gics Github project Build badge for gics Github project Last release badge for gics Github project Code coverage badge for gics Github project

Warning

There is still plenty work to do on this project and it certenaly cannot be used in a production environment

This project is intended to implement the RFC5545 - Internet Calendaring and Scheduling Core Object Specification (you can find the Request Of Comments here)

The genesis 🧠

I decided to create this go module because existing options didn't meet my needs or were no longer maintained.

Main features πŸš€

Here the main features this module offers (some are already available βœ… and some are still in WIP state 🟧)

  • βœ… Create an iCalendar object
    • βœ… With VEVENT components
    • βœ… With VALARM components
    • βœ… With VJOURNAL components
    • βœ… With VFREEBUSY components
    • βœ… With VTIMEZONE components
    • βœ… With VTODO components
  • 🟧 Make use of all properties available
  • 🟧 Make use of all types available
  • 🟧 Parse an iCalendar file
  • βœ… Write in an iCalendar file

Installation

To install gics, use the go get command:

go get github.com/vareversat/gics

Example

  • Create and display an iCalendar
package main

import (
	"github.com/vareversat/gics/pkg"
	"github.com/vareversat/gics/pkg/components"
	"github.com/vareversat/gics/pkg/properties"
	"github.com/vareversat/gics/pkg/types"
	"os"
	"time"
)

func main() {
	// Create an array of VEVENT component
	v := components.NewEventCalendarComponent(
		properties.NewUidProperty("My_EVENT"),
		properties.NewDateTimeStampProperty(time.Now(), types.WithUtcTime),
		properties.NewDescriptionProperty("This is an event of my calendar !"))
	c := make(components.CalendarComponents, 0)
	c = append(c, v)
	
	// Create an iCalendar with the previously created VEVENT
	calendar, err := pkg.NewCalendar(c, "My_CALENDAR", "PUBLISH", "2.0")
	if err != nil {
		panic(err)
	} else {
		// Print the iCalendar in the stdout
		calendar.SerializeToICSFormat(os.Stdout)
	}
}

About

πŸ“… A Go module is implemented to adhere to RFC5545 standards, facilitating the creation and utilization of iCalendars across the internet.

License:MIT License


Languages

Language:Go 99.1%Language:Makefile 0.9%