Skip to content

guchio/ical

 
 

Repository files navigation

ical

Work with ical formatted data in Go

Build Status GoDoc

DESCRIPTION

This is partially a port of Data::ICal (perl5 module) to Go.

Parse an ics file:

import "github.com/lestrrat-go/ical"

// snip...
p := ical.NewParser()
c, err := p.ParseFile(file)

// snip
for e := range c.Entries() {
  ev, ok := e.(*ical.Event)
  if !ok {
    continue
  }

  // work with event.
}

Programatically generate a Calendar

import "github.com/lestrrat-go/ical"

// snip...
c := ical.New()
c.AddProperty("X-Foo-Bar-Baz", "value")
tz := ical.NewTimezone()
tz.AddProperty("TZID", "Asia/Tokyo")
c.AddEntry(tz)

ical.NewEncoder(os.Stdout).Encode(c)

About

Work with ical formatted data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%