Coder Social home page Coder Social logo

gics's Introduction

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. This package may be uses in a production environment at your own risks !

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

Type representations

Type name Go type
BINARY string (base64 representation)
BOOLEAN bool
CAL-ADDRESS uri.URL
DATE time.Time
DATE-TIME time.Time
DURATION string
FLOAT float32
INTEGER int32
PERIOD time.Time / time.Time
RECUR complex
TEXT string
TIME time.Time
URI uri.URL
UTC-OFFSET string

Example

  • Create and display an iCalendar
package main

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

func main() {
  // Create an array of VEVENT component
  calendarComponents := components.CalendarComponents{}
  // Create a VEVENT component
  c := components.NewEventCalendarComponent(
    properties.NewUidProperty("My_EVENT"),
    properties.NewDateTimeStampProperty(time.Now().UTC()),
    []components.AlarmCalendarComponent{}, // Empty VALARM
    properties.NewDateTimeStartProperty(time.Now(), types.WithUtcTime),
    properties.NewDescriptionProperty("This is an event of my calendar !"))
  calendarComponents = append(calendarComponents, c)

  // Create an iCalendar with the previously created VEVENT
  calendar, err := gics.NewCalendar(calendarComponents,
    "-//Valentin REVERSAT//https://github.com/vareversat/gics//FR",
    "PUBLISH",
    "2.0")
  if err != nil {
    panic(err)
  } else {
    // Print the iCalendar in the stdout
    calendar.SerializeToICSFormat(os.Stdout)
  }
}

gics's People

Contributors

vareversat avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.